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
Anonymous
Not applicable

Calculate diff time based on different rows

Hi Guys,

 

is it possible to calculate the time diff based on different rows?

 

IDTime RegisterNamePlace of workStarting or finishing work?
17/1/21 8:03JohnHomeStarting
27/1/21 8:10AhbraHomeStarting
37/1/21 8:20ElisaHomeStarting
47/1/21 15:10ElisaHomeFinishing
57/1/21 16:00JohnHomeFinishing
67/1/21 13:00AbhraHomeFinishing
77/1/21 8:25JohnOfficeStarting
87/1/21 8:03ElisaHomeStarting
98/1/21 13:20JohnOfficeFinishing
108/1/21 13:03ElisaHomeFinishing

 

For example

 

I need to john how many hours John worked from home and from the office.

 

Thank you

 

 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

This is quite hard in DAX. But I recorded a video a few years ago showing how you can do it in Power Query https://youtu.be/xN2IRXQ2CvI



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

On the same day, how can Elise have 2 starting points from Home (ID 3 and 8).  Please check your data.  Also, please maintain the same spelling of Ahbra.  Share data after thoroughly checking.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MattAllington
Community Champion
Community Champion

This is quite hard in DAX. But I recorded a video a few years ago showing how you can do it in Power Query https://youtu.be/xN2IRXQ2CvI



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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