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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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