Forum Discussion
villa1980
1 year agoResolver II
Time Duration between rows
I am trying to look at the duration between the end date and next start date for each STARTDATE category. I am using the below DAX and is coming out with some weird results which I am struggling to ...
villa1980
1 year agoResolver II
Thank-you for the response, it is returning the below which is still not correct
Anonymous
1 year agoNot applicable
Hi villa1980 , hello ryan_mayu and rajendraongole1, thank you for your prompt reply!
Per my test, I could use the following measure to calculate the differences between startdate as shown below:
NextTaskDuration =
VAR _CurrentTaskStart = SELECTEDVALUE('Table'[STARTDATE])
VAR _NextTaskStart =
CALCULATE(
MIN('Table'[STARTDATE]),
FILTER(
ALL('Table'),
'Table'[STARTDATE]> _CurrentTaskStart
)
)
VAR _TimeDifferenceInMinutes =
IF(
ISBLANK(_NextTaskStart),
0,
DATEDIFF(_CurrentTaskStart, _NextTaskStart, MINUTE)
)
RETURN
_TimeDifferenceInMinutes
Result:
You could also provide more details about your issue or upload a sample PBIX file for better troubleshooting.
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- villa19801 year agoResolver II
This is strange, I have the exact same DAX but has these strange returns. I have attached the pbix file
https://drive.google.com/file/d/1YWVZfHt1t1lodS6TxFmIt_U1Fk0js2Xb/view?usp=drive_link