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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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 is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.