Hi
I have a requirement to write a measure to find the difference in days (return an integer) between the first purchase and the last purchase made by a customer within a given time period.
Below are my thoughts but may be wrong:
VAR Firstpurchasedate = Date
VAR Nextpurchasedate = MIN(Date)
VAR DiffInDates = DATEDIFF(Firstpurchasedate, Nextpurchasedate) (where Nextpurchasedate >= Firstpurchasedate )
I know the above is not a DAX language but my thoughts.
How do I accomplish this, please?
Thank you
Days_Between 1st_and_Last_Purchase.pbix (221.1 KB)