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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Hello!! I need to calculate 'Number of working hours between 2 dates'

This is achieved in MS Excel using the formula "=24*NETWORKDAYS(B2,C2)-24*((1-MOD(C2,1))+(MOD(B2,1)))"

 

tjravi28_0-1630997710468.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create calculated column as below to get it:

Working Hours between dates = 
24
    * COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                CALENDAR ( 'Table'[Start_Date], 'Table'[End_Date] ),
                "Day of Week", WEEKDAY ( [Date], 2 )
            ),
            [Day of Week] < 6
        )
    )
    - 24
        * (
            ( 1 - MOD ( 'Table'[End_Date], 1 ) )
                + ( MOD ( 'Table'[Start_Date], 1 ) )
        )

yingyinr_0-1631172961878.png

In addition, you can refer the content in the following links to achieve it.

DAX Fridays! #47: NETWORKDAYS

equivalent function of Networkdays in DAX

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can create calculated column as below to get it:

Working Hours between dates = 
24
    * COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                CALENDAR ( 'Table'[Start_Date], 'Table'[End_Date] ),
                "Day of Week", WEEKDAY ( [Date], 2 )
            ),
            [Day of Week] < 6
        )
    )
    - 24
        * (
            ( 1 - MOD ( 'Table'[End_Date], 1 ) )
                + ( MOD ( 'Table'[Start_Date], 1 ) )
        )

yingyinr_0-1631172961878.png

In addition, you can refer the content in the following links to achieve it.

DAX Fridays! #47: NETWORKDAYS

equivalent function of Networkdays in DAX

Best Regards

amitchandak
Super User
Super User

@Anonymous , if you need business hours refer this

https://exceleratorbi.com.au/calculating-business-hours-using-dax/

 

If you need business day * 8

refer

Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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