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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Going crazy over this one. Someone has probably done it before
I have some date/time stamps for event ON and OFF as follows
Sometimes what is considered one event is actually recorded as more than one event.
[ON] [OFF]
14/09/2023 9:16 14/09/2023 9:53
14/09/2023 12:08 14/09/2023 12:59
15/09/2023 2:05 15/09/2023 2:24
15/09/2023 2:24 15/09/2023 2:34
15/09/2023 2:34 15/09/2023 2:35
15/09/2023 2:35 15/09/2023 2:43
15/09/2023 2:50 15/09/2023 3:35
17/09/2023 0:47 17/09/2023 1:15
21/09/2023 13:48 21/09/2023 14:20
21/09/2023 15:49 21/09/2023 16:00
23/09/2023 13:39 23/09/2023 14:30
24/09/2023 11:41 24/09/2023 12:22
26/09/2023 18:41 26/09/2023 19:26
5/10/2023 21:35 5/10/2023 22:23
What I'd like to do is aggregate the results of this table into another table that shows any events within say 80min of another, and report the total duration.
For example in the case of
[ON] [OFF] [DURATION] [DIFFERENCE FROM LAST ON]
14/09/2023 12:08 14/09/2023 12:59 50.9
15/09/2023 2:05 15/09/2023 2:24 18.65
15/09/2023 2:24 15/09/2023 2:34 9.7
15/09/2023 2:34 15/09/2023 2:35 1.1
15/09/2023 2:35 15/09/2023 2:43 7.8
15/09/2023 2:50 15/09/2023 3:35 45.53333333
17/09/2023 0:47 17/09/2023 1:15 28.06666667
21/09/2023 13:48 21/09/2023 14:20 32.85
21/09/2023 15:49 21/09/2023 16:00 11.21666667
23/09/2023 13:39 23/09/2023 14:30 50.5
A group would be
[ON] [OFF] [DURATION]
15/09/2023 2:24 15/09/2023 2:50 64.13
and the table would continue until it needed to bunch other events together as one.
Thanks!
Thanks, this is useful for returning the difference from previous event but I'm still stuck on then aggregating these into groups
@123CaM321 , Difference with last off
datediff(maxx(filter(Table, [Off] < earlier([ON])), [OFF]), [ON], Second)
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!