Forum Discussion
Calculating time between two rows in the same column
- 6 years ago
🙂Anonymous
Diff = VAR __Previous = MINX ( FILTER ( 'Table', 'Table'[Date] = EARLIER ( 'Table'[Date] ) && 'Table'[Time] > EARLIER ( 'Table'[Time] ) ), 'Table'[Time] ) VAR __diff = __Previous - 'Table'[Time] RETURN __diff
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
🙂Anonymous
Diff =
VAR __Previous =
MINX (
FILTER (
'Table',
'Table'[Date] = EARLIER ( 'Table'[Date] )
&& 'Table'[Time] > EARLIER ( 'Table'[Time] )
),
'Table'[Time]
)
VAR __diff = __Previous - 'Table'[Time]
RETURN
__diff
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Good afternoon @nandukrishnavs.
I have a similar situation. I tried the two recommended solutions, resulting in what is shown in the following image:
Sometimes it works, so the solution I need should not be far away. To explain my case, each row represents a movement (or modification of the ticket) this group for a help desk ticket (14 movements). I have a column with the date and another with the modification time. I also concatenated both columns in the "Date & Time" column.
I need to calculate how much time passed between each movement. For example, from the first move to the second passed 00h:40m:59s.
The result can be in duration format or could indicate the number of seconds in total and then convert it to minutes or hours.
I hope you can help me.
Best regards
Richard