I'm trying to determine how many return appointments each customer had within a set timeframe from their last appointment. I need to identify per row whether that particular appointment is a 'return' appointment within 48hrs of them leaving their last appointment (i.e. was their appointment start time within 48hrs of their prior appointment end time)?
I have tried to find an answer but I'm not really sure what I'm looking for and am relatively new to dax so apologies if this is something basic. I can do the first part relative to the latest appointment as it is simply a max of all the appointments for that customer.
=CALCULATE(max([End Time]),ALLEXCEPT(Table,Table[Customer ID]))
What I'm struggling with is how to incorporate the extra filter to only look at prior appointments (relative to each row). I'm assuming that if I could return a table that was filtered to only show those prior records I could then get the max and compare that but not sure how to go about writing that in dax.
Many thanks for any assistance.
Cheers, Chris.