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

DAX to find sum duration between datetimes discounting overlapping periods

I have a table with data in columns [member_id], [begin datetime], [end datetime].

Annotation 2019-10-23 232235.png

I can sum the duration in hours between [begin datetime] and [end datetime], this is trivial in powerquery, however my source data includes overlaps between the [begin datetime] and [end datetime] ranges.

 

For example:

 

01/01/2018 06:00:00 - 01/01/2018 10:00:00 (Duration 4 hours)

01/01/2018 12:00:00 - 01/01/2018 14:00:00 (Duration 2 hours)

01/01/2018 09:00:00 - 01/01/2018 13:00:00 (Duration 4 hours)

01/01/2018 18:00:00 - 01/01/2018 20:00:00 (Duration 2 hours)

 

The sum of the above durations is 12 hours however the time window covered is 10 hours when you exclude overlapping periods.

 

How can I get the answer of 10 hours using a DAX measure?

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may try to sort columns and consolidate ranges in the Query Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-chuncz-msft wrote:

@Anonymous 

 

You may try to sort columns and consolidate ranges in the Query Editor.



@v-chuncz-msft can you give an example of how is that done with this example data?

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