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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tabuzahra
Helper II
Helper II

Count Weekdays Between Two Date Excluding Weekends

Dears,

Thank you for your usual support. Kindly, I would like to count the weekends between two dates.

 

The scenario is, I have projects creation date and there is some projects have initial baseline (in case the project has been baselined). In case there is a baseline, then I need to count the weekdays (without weekends) between (Initial Baseline & Creation date)

Otherwise, the measure should count the weekdays (without weekends) between (Today & Creation date)

 

Note: I have already a calender date and I have identified if the date is a weekend or not (1 if weekends and 0 is weekday)

 

This is a sample data

Project Name: Project X

Creation Date: 1/26/2020

Initial Baseline Date: Blank

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Max date can be replaced with today

Working day = CALCULATE(COUNTx(FILTER(Project,Project[Creation Date]<=max('Date'[Date]) && 
(ISBLANK(Project[End Date]) || Project[End Date]>max('Date'[Date])) && date[Weekday]=1),(date[date]))
,CROSSFILTER(Project[Creation Date],'Date'[Date],None))

 

also refer :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @tabuzahra ,

 

You could use COUNTROWS() function. Then you could put date range and conditional column = 0 into your filter.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

Max date can be replaced with today

Working day = CALCULATE(COUNTx(FILTER(Project,Project[Creation Date]<=max('Date'[Date]) && 
(ISBLANK(Project[End Date]) || Project[End Date]>max('Date'[Date])) && date[Weekday]=1),(date[date]))
,CROSSFILTER(Project[Creation Date],'Date'[Date],None))

 

also refer :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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