Forum Discussion
Anonymous
5 years agoNot applicable
Substract from Different Rows on a Table
Hi Team. Is there a way to reproduce this in Powerbi.? This is the table I have to, in theory, I would like to subtract the time or duration between 1:11 AM and 1:04AM the same way I did in my...
Fowmy
5 years agoSuper User
Anonymous
You need to first add an index column in Power Query then add the following DAX column to the table:
Time Diff =
var __currtime = Table2[Start Time]
var __previoustime = MAXX( FILTER( Table2 , Table2[Index] = EARLIER(Table2[Index]) - 1), Table2[End Time])
var _Diff = DATEDIFF(+__previoustime , __currtime, SECOND )
return
_Diff
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂