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

Calculating Working Days Between 2 Dates

I have this table:

1.PNG

Step 1 was figuring out how to get the earliest and latest dates for each StageName via the CreatedDate field which I did through these measures:

2.PNG

3.PNG

This helps setup to see how many days was spent in each stage. You can see those values on my Date Diff StageName measure above:

4.PNG

 

While this works as intended I would like to be able to grab working days only. So for 'Discovery' above, it was in that stage for 13 total days. However between 9/26 and 10/9 there are only 9 working days. How can I return that value instead?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi there,
 
Try this, and Please let me know if it work. Good luck!!
 
Work_Days = COUNTROWS(FILTER(CALENDAR('Opportunity History'[Earliest Date],'Opportunity History'[Latest Date]), WEEKDAY([Date])<>1 && WEEKDAY([Date])<>7))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi there,
 
Try this, and Please let me know if it work. Good luck!!
 
Work_Days = COUNTROWS(FILTER(CALENDAR('Opportunity History'[Earliest Date],'Opportunity History'[Latest Date]), WEEKDAY([Date])<>1 && WEEKDAY([Date])<>7))
CoreyP
Solution Sage
Solution Sage

Hi there!

 

This is quite a common issue. Search the forum for solved posts and I'm certain you'll find it! Pretty sure you'll need to create a date table with some custom columns like "Weekend vs. Weekday," "Holidays," and finally an "Is Workday," which typically returns a 1 or a 0, and then you SUM that column between your two dates.

 

Hope this helps!

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