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
rbowen
Helper III
Helper III

Help With Networkdays Excluding Holidays Using Calendar Table

I need to calculate the number of budget units per day from a table that only gives the budget numbers in terms of the entire month. I've created a calendar table that dynamically calculates when US holidays fall on a weekday and it has a one to many relationship with my budget table. One of the columns in the calendar table is Holidays, which lists the name of the holidays that fall on weekdays. I've attached a link to a sample pbix file for reference. A calculated column in my budget table uses the NETWORKDAYS function to calculate the number of workdays between each period's start and end dates. I also have a calcuated column that determines that amount of budget units per days based on total workdays and entire month budget. In the screenshot below, the WorkDays column shows 23 days for January, but the number should be 22 taking January 1st into account. 

 

rbowen_0-1740763870733.png

 

I've tried various ways to get the NETWORKDAYS function to use my calendar table but am having no luck. Ultimately, the DAX needs to calculate the number of weekdays between the PeriodStartDate and PeriodEndDate columns in the BudgetUnits table based on when the Holidays column in the Calendar table is blank. Is this possible?

 

Thank you. 

 

Sample PBIX File 

1 ACCEPTED SOLUTION

Hi,

Please check the attached file.

Ashish_Mathur_0-1741053259171.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

NETWORKDAYS expects a separate table for the holidays.  You have the holidays included as a column in the calendar table, so you don't need to use NETWORKDAYS.

 

Your BudgetUnits[Workdays] is a calculated column and will ignore the date slicer. Same with the BudgPerDay.

 

lbendlin_0-1740786944917.png

 

 

 

 

 

lbendlin - 

 

Thank you, that got the number working days correct. I'm finding that my calculation for determining the month to date value for the budget units isn't working, specifically with a YearMonth slicer instead of a date slider. When placed into a table, the value is blank. Both BudgetUnits[Workdays] and BudgPerDay functions are now measures instead of calculated columns.  I need to display the MTD value of the budget units based on what YearMonth value users select in the YearMonth slicer.

Hi,

Please check the attached file.

Ashish_Mathur_0-1741053259171.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you Ashish, that appears to have done the trick. And thank you @lbendlin , your answer was part of the solution as well, I had a filter set incorrectly that causing some of the data to go missing. Many thanks to you both. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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
Top Kudoed Authors