Forum Discussion
Anonymous
6 years agoNot applicable
Calculate period
Hallo everyone, If I have this table and I want to calculate for each ID the duration between the end time and the start time of the next event. In the column marked in green is the value I ...
- 6 years ago
Hi Anonymous ,
You may create measure like DAX below.
DiffTime= Var _ThisTime = SELECTEDVALUE(Table1[Event time]) Var _SecondTime= CALCULATE(MIN(Table1[Start time]),FILTER(ALLSELECTED(Table1), Table1[ID] =MAX(Table1[ID]) && Table1[Event time] >_ThisTime )) Return DATEDIFF(_ThisTime , _SecondTime, MINUTE )Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xicai
Community Support
6 years agoHi Anonymous ,
You may create measure like DAX below.
DiffTime=
Var _ThisTime = SELECTEDVALUE(Table1[Event time])
Var _SecondTime= CALCULATE(MIN(Table1[Start time]),FILTER(ALLSELECTED(Table1), Table1[ID] =MAX(Table1[ID]) && Table1[Event time] >_ThisTime ))
Return
DATEDIFF(_ThisTime , _SecondTime, MINUTE )
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.