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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Count of days within two dates

Hi Gurus,

 

I would like to create a calculated column to get the number of working days between two dates that are in a specific month.

 

 

For example: 

 

Date 1

27-August-2023

 

Date 2 

8-September-2023

 

Working Days within the two days in September = 5 (Sun-Thu work week)

 

Appreciate your help 🙂

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Anonymous 

You can use networkdays function.

https://learn.microsoft.com/en-us/dax/networkdays-dax

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Anonymous
Not applicable

Hi @Anonymous 

You can refer to the following measure

Column =
VAR a =
    ADDCOLUMNS (
        CALENDAR ( [Column1], [Column2] ),
        "Workday", WEEKDAY ( [Date], 1 ),
        "Month", MONTH ( [Date] ),
        "Year", YEAR ( [Date] )
    )
RETURN
    COUNTROWS (
        FILTER (
            a,
            [Workday] < 6
                && [Year] = YEAR ( [Column2] )
                && [Month] = MONTH ( [Column2] )
        )
    )

Output

vxinruzhumsft_1-1696302934806.png

Best Regards!

Yolo Zhu

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 @Anonymous 

You can refer to the following measure

Column =
VAR a =
    ADDCOLUMNS (
        CALENDAR ( [Column1], [Column2] ),
        "Workday", WEEKDAY ( [Date], 1 ),
        "Month", MONTH ( [Date] ),
        "Year", YEAR ( [Date] )
    )
RETURN
    COUNTROWS (
        FILTER (
            a,
            [Workday] < 6
                && [Year] = YEAR ( [Column2] )
                && [Month] = MONTH ( [Column2] )
        )
    )

Output

vxinruzhumsft_1-1696302934806.png

Best Regards!

Yolo Zhu

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

Ritaf1983
Super User
Super User

Hi @Anonymous 

You can use networkdays function.

https://learn.microsoft.com/en-us/dax/networkdays-dax

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.