Forum Discussion
Anonymous
3 years agoNot applicable
Calculate difference in time between dates in same column
Hi all, I have the following column, and I wish to calculate the difference between each row - ie the length of time between Row 2 (20/08/18) and Row 1 (18/01/2017). Any ideas on ...
OwenAuger
Super User
3 years agoHi Anonymous
The OFFSET function would work well here.
To come up with the exact DAX expression, we would need to clarify:
- What determines the sort order? I can see the dates in your image are not in ascending/descending order. Is there another column partitioning or defining the sort order?
- Do you want a measure (which would respond to filters) or a calculated column?
In the case of a measure, we would need to clearly define which dates are included, for example it could be all dates visible in the filter context, or all dates for which certain measure(s) are nonblank.
Regards,
Owen