The table looks like this: [Table]:
https://i.stack.imgur.com/S48p6.png
I already create a reference column rank using RANKX to sort the table by TaskNum and its Modified_Time. Now I just need to calculate the difference between the current row to the previous row to get the time interval:
The result I expect is like this:[Expected Result]:
+
https://i.stack.imgur.com/pCyon.png
I tried to write DAX:
IF(
Table[TaskNum] = LOOKUPVALUE(Table[TaskNum],Table[rank],Table[rank]-1),
DATEDIFF(LOOKUPVALUE(Table[Date],Table[rank],Table[rank]-1),Table[Date],DAY)
,0)
I think it quite makes sense, but an error occurs: A table of multiple values was supplied where a single value was expected.
Please help me to fix it, thx!!!!!!!