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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hjoubert
Frequent Visitor

Calculate total days from multiple date ranges in another table

Hi everynone, I'm new to DAX and need help calculating total days a checklist was on hold - I have 2 tables, 1. RFI table and 2. Checklist table.

I want to calculate the total days (total networkdays, excluding public holidays and overlaps) from the RFI table per checklist ID and show the total in the Checklist table. This will be used to subtract total on hold days from the total checklist duration to measure statutory performance. The last part is not part of this question, only how to calculate the total on hold days. 

Below an example of the 2 tables.

 

hjoubert_1-1664150916774.png

Thanks Hennie

 

1 ACCEPTED SOLUTION

@hjoubert So like this? Overlap - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
hjoubert
Frequent Visitor

@Greg_Deckler 

Thanks for your reply Greg, your solution is working where all the dates are overlapping but is my example, some of the dates do not overlap. Is there a way of calculating the durations one by one and checking if there are overlaps and then exclude the overlapping parts, but add the durations where the dates do not overlap? Kind regards Hennie

@hjoubert So like this? Overlap - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@hjoubert Put Checklist ID in a table visual along with this measure:

Net Work Days =
  VAR __Start = MIN('Table'[Start])
  VAR __End = MAX('Table'[End])
RETURN
  NETWORKDAYS(__Start, __End, 1, { DATE(2022,12,31), DATE(2023,1,1) }


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for your reply Greg, your solution is working where all the dates are overlapping but is my example, some of the dates do not overlap. Is there a way of calculating the durations one by one and checking if there are overlaps and then exclude the overlapping parts, but add the durations where the dates do not overlap? Kind regards Hennie

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.