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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eddd83
Resolver I
Resolver I

Measure to calculate time duration for 24+ hour periods

I have the following data

 

EventStart timeEnd timeDuration (HR)
AJan 1 1:00 PMJan 1 2:00 PM1
BJan 2 1:00 PMJan 2 2:00 PM1
CJan 2 1:00 PMJan 4 1:00 PM48

 

I want to produce the following with a measure

 

Datedesired measure (hr)
Jan 11
Jan 212
Jan 324
Jan 413

 

Help?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@eddd83 OK, I'll bite, how are you arriving at those numbers in your expected results? Do you need something like Overlap for computing minutes with time intervals? Attached below sig. Maybe Open Tickets? https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Noah_Mom
Regular Visitor

Hi. I also need help with this. Have you found the solution?

Greg_Deckler
Super User
Super User

@eddd83 OK, I'll bite, how are you arriving at those numbers in your expected results? Do you need something like Overlap for computing minutes with time intervals? Attached below sig. Maybe Open Tickets? https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Your ticket file is not exactly what i need, but i think it should be a good template that I can start with. Thank you.

@eddd83 OK, let me know if you need assitance, just @ me. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

sorry for the poor formatting resulting in the poor readability. I can't figure out how to fix it

 

 

Event A only happens in Jan 1 for 1 hour. 

Event B only happens in Jan 2 for 1 hour.

 

Event C occurs in Jan 2 from 1pm to midnight (11 hours)

then in jan 3, it occurs all day (24 hours)

then in jan 4, it occurs from midnight to 1pm (13 hours)

 

Therefore:

Jan 1 - 1 hour

Jan 2 - 12 hours total = 1 hour (event B) + 11 hours (event C) 

Jan 3 - 24 hours (event C)

Jan 4 - 13 hours (event C)

here is a picture 

 

excel.JPG

@eddd83 Right, so it is a variation on both of the solutions I presented, glad to know it is an actual date/time column, what you posted as sample data was not. I'll have to mock it up, these things tend to get interesting. Have a look at the solutions in my first response to get an idea what you are in for.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.