Forum Discussion
rpinxt
2 years agoSolution Sage
Count time between rows
Probably not that difficult but still I am strugling. Here is the issue: I want to make a measure that shows me how many time each step took. So second line would be 7:34 -/- 7:32 resulting ...
Greg_Deckler
2 years agoCommunity Champion
rpinxt Perfect! Try this (PBIX is attached below signature)
Time Spent (Minutes) =
VAR __Current = [Time]
VAR __Previous = MAXX(FILTER('Table 1','Table 1'[Time] < __Current),[Time])
VAR __Result = IF( __Previous = BLANK(), 0, ( __Current - __Previous ) * 1. * 24 * 60)
RETURN
__Result
rpinxt
2 years agoSolution Sage
Thanks very much Greg.
First thought you made a measure but this is calculated column correct?
Works like a charm.
But I have a new concern now....
Out columns have a different order, I set that order in a table visual.
I tried changing the columns in the query editor but the original order remains in the table view in Power BI.
Is there another solution to change the order of the columns then change it in the source?