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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
yaya1974
Helper III
Helper III

Work Days in Month

Hi, I need a calucation to give me the work day of each month.

Do you have a formula that calculates business days, excluding weekends and holidays?

So, like this year 1/2/24 is working day 1. But I am looking for it to start over each month.

All the examples I have found are total working days for the year. I need for the month. And not total, meaning not 22 days in Jan. I need 1 – 22 detailed out for each month.

Jan 2 = 1

Jan 3 = 2

Jan 4 = 3, 

Feb 1 = 1 , etc.

 

This is what I have right now, but is reserved.   

= NETWORKDAYS('Date'[Start Date],'Date'[End Date])   

This is results:

Jan 1 = 23

Jan 2 - 22, etc.

 

Any help ?

Thank you!

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Don't waste your time .  Use an external table.  It's not necessary to calculate this over and over again.

View solution in original post

Anonymous
Not applicable

Hi @yaya1974 ,

First use this DAX to add a new column:

Month = MONTH('Table'[Date])

vjunyantmsft_0-1708052095612.png

Then please try this DAX to create a new column:

NETWORKDATS = 
VAR MIN_DAY = 
CALCULATE(
    MIN('Table'[Date]),
    FILTER(
        'Table',
        'Table'[Month] = EARLIER('Table'[Month])
    )
)
VAR MAX_DAY = 
CALCULATE(
    MAX('Table'[Date]),
    FILTER(
        'Table',
        'Table'[Date] <= EARLIER('Table'[Date]) && 'Table'[Month] = EARLIER('Table'[Month])
    )
)
RETURN
NETWORKDAYS(MIN_DAY, MAX_DAY)

The final output is as below:

vjunyantmsft_1-1708052110377.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @yaya1974 ,

First use this DAX to add a new column:

Month = MONTH('Table'[Date])

vjunyantmsft_0-1708052095612.png

Then please try this DAX to create a new column:

NETWORKDATS = 
VAR MIN_DAY = 
CALCULATE(
    MIN('Table'[Date]),
    FILTER(
        'Table',
        'Table'[Month] = EARLIER('Table'[Month])
    )
)
VAR MAX_DAY = 
CALCULATE(
    MAX('Table'[Date]),
    FILTER(
        'Table',
        'Table'[Date] <= EARLIER('Table'[Date]) && 'Table'[Month] = EARLIER('Table'[Month])
    )
)
RETURN
NETWORKDAYS(MIN_DAY, MAX_DAY)

The final output is as below:

vjunyantmsft_1-1708052110377.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Don't waste your time .  Use an external table.  It's not necessary to calculate this over and over again.

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors