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! Learn more

Reply
Maru
Helper I
Helper I

How to find holidays between two dates? What DAX should be used instead of NETWORKDAYS ?

Unlike Excel, Dax NETWORKDAYS requires weekend parameter. 

This is my workaround but it always takes 10 seconds when I touch this calculated columns although the elements in 'holidays lists' table is about the same.

VAR holidays_count = COUNTROWS(FILTER('holidays lists', 'holidays lists'[date] >= table[start Date] && 'holidays lists'[date]    <= end Date))

 
Any better way to do it ? Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Maru ,

 

You can try formula like below:

HolidaysCount =
IF (
    CALCULATE (
        COUNTROWS ( 'holidays lists' ),
        FILTER (
            'holidays lists',
            'holidays lists'[date] >= MAX ( YourTable[Start Date] )
                && 'holidays lists'[date] <= MAX ( YourTable[End Date] )
        )
    ) > 0,
    "holiday",
    "no holiday"
)

vkongfanfmsft_0-1705892353171.png

 

Best Regards,
Adamk Kong

 

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 @Maru ,

 

You can try formula like below:

HolidaysCount =
IF (
    CALCULATE (
        COUNTROWS ( 'holidays lists' ),
        FILTER (
            'holidays lists',
            'holidays lists'[date] >= MAX ( YourTable[Start Date] )
                && 'holidays lists'[date] <= MAX ( YourTable[End Date] )
        )
    ) > 0,
    "holiday",
    "no holiday"
)

vkongfanfmsft_0-1705892353171.png

 

Best Regards,
Adamk Kong

 

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

saurabhtd
Resolver II
Resolver II

@Maru  You can try this logic. 

holidays_count =
    CALCULATE(
        COUNTROWS('holidays lists'),
        TREATAS(
            VALUES('holidays lists'[date]),
            'table'[start Date],
            'table'[end Date]
        )
    )

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.