Forum Discussion
Time duration between multiple events with start and stop
- 5 years ago
Hi zinminthant
You'd have to split the Events column to have the type of the event (Start, Stop...) and the name of the entity the event happens on (A, B...) in separate columns. Best to do this in Power query. Then you can create a column like this:
Duration (hr) = VAR previousStart_ = CALCULATE ( MAX ( Table1[DateTime] ), ALLEXCEPT ( Table1, Table1[Entity] ), Table1[Event Type] = "Start", Table1[DateTime] < EARLIER ( Table1[DateTime] ) ) RETURN IF ( Table1[Event Type] = "Stop", ( Table1[DateTime] - previousStart_ ) * 24 )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- 5 years ago
See it all at work in the attached file.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
See it all at work in the attached file.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers