Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
thatalexboyd
Frequent Visitor

How to find time passed in a series of records

Hey, I am trying to find the time passed between two events in a series of data. The series are defined by a session_id that is the same for all events. I know I wanty to order the data then fid the differnece between the first and last, but I am not sure how. Whenever I start with an index column it wants to index each opne in order, not the group. Any help would be great, and a sample of data is below.

 

2021-03-16_8-40-13.jpg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@thatalexboyd , You can create a measure like

 

averageX(values(Table[session ID]), datediff(Min(Table[eventtime]),max(Table[eventtime]),second))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@thatalexboyd , You can create a measure like

 

averageX(values(Table[session ID]), datediff(Min(Table[eventtime]),max(Table[eventtime]),second))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

So I adjusted the above measure and it looks like it is working! I guess a follow up question, how does an AverageX accomplish this since it a difference? 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors