Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I would like to calculate the duration in seconds between two events spent on the same equipment tool.
DurationInSeconds =
VAR Current_DateTime = MAX(UTILITY_HISTORY[EV_TIME])
VAR T1 =
CALCULATETABLE (
'UTILITY_HISTORY',
ALLEXCEPT ( 'UTILITY_HISTORY', 'UTILITY_HISTORY'[EQUIP_ID] )
)
VAR T2 =
FILTER ( T1, UTILITY_HISTORY[EV_TIME] < Current_DateTime )
VAR T3 =
TOPN ( 1, T2, UTILITY_HISTORY[EV_TIME], DESC )
VAR NextDateTime =
SELECTCOLUMNS ( T3, "@DateTime", UTILITY_HISTORY[EV_TIME] )
VAR Result =
IF ( NOT ISBLANK ( NextDateTime ), Current_DateTime - NextDateTime )
RETURN
Result
Can anyone please help me figure out how list durations starting from step-1 ?
I appreciate any help to make it work.
Solved! Go to Solution.
@Lazurens , Use offset function
New measure = Calculate(Max(Table[Duartion]), offset(-1, allselected(Table[Equip], Table[EV_time]), Orderby([EV_time],asc) )
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
@Lazurens , Use offset function
New measure = Calculate(Max(Table[Duartion]), offset(-1, allselected(Table[Equip], Table[EV_time]), Orderby([EV_time],asc) )
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |