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! Learn more

Reply
Kristiankommune
Frequent Visitor

Differense between 2 dates and time

Ive got a table with columns like this.

1 column, persons (ID)

1 column with date and time (shiftstart)

1 column with date and time (shiftto)

 

And i want to see how many rows that have less then 11 hours between shiftstart and shiftto per person.

Person 1:

Shiftstart: 2023-01-03 16:00:00

Shiftto: 2023-01-03 22:00:00

 

Shiftstart: 2023-01-04 07:00:00

Shiftto: 2023-01-04 16:00:00

 

That would result in 1 row. Less then 11 hours between when the first shift ended to the second shift started. 

I dont have a clue how to make this work 😕 

4 REPLIES 4
Idrissshatila
Super User
Super User

@Kristiankommune ,

 

try this

Hours = Datediff ( ShiftFrom, ShiftTo, Hour )

 

Just put the field shift from and shift to in the measure.

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




I tried it but it only counts the hours between shiftstart and shiftto on one line.

I want to know the hours between date 1 and date 2. 

If there is less then 11 hours between ShiftTo date 1 and ShiftStart date 2. 

Idrissshatila
Super User
Super User

Hello @Kristiankommune ,

 

check if you could use this video for your case https://youtu.be/6JA6uy3ZRBA

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




I dont know if that helped me.

This is my table below. 

This is the same person (perid). 

And the two dates has less then 11 hours between the end of 21/2 and the start of 22/2. 

Kristiankommune_0-1677012817228.png

 

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