Forum Discussion
Anonymous
6 years agoNot applicable
Time differences between two date/time values in same column
How can I create a column that will provide the time elapsed between two cells. For example the difference in time between 1:35:21 and 2:20:47 in the second cell of the column labeled column ...
Icey
6 years agoCommunity Support
Hi Anonymous ,
How about this?
1. Create a Rank column. Or, you can just add an Index column in Power Query Editor and then use this Index column instead of Rank column in the second expression.
Rank = RANKX('Table','Table'[Date/Time],,ASC,Dense)
2. Create a measure to show the datediff.
Measure =
VAR PreDateTime =
CALCULATE (
MAX ( 'Table'[Date/Time] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] = MAX ( 'Table'[Rank] ) - 1 )
)
RETURN
DATEDIFF ( PreDateTime, MAX ( 'Table'[Date/Time] ), SECOND )
Please close other unnecessary programs.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
6 years agoNot applicable
Still running into the issue of power bi endlessly calculating and not creating any results....