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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors