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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Mopadii
New Member

Combine VALUES and FILTER

Hi all,

Can you please support with the following DAX.

I try to calculate networking day between 2 dates, excluding holidays and weekend.
My holidays table is multi-dimensional, it covers every countries. I tried this but it is not a valid syntax...

= NETWORDAYS( _startdate, _enddate, 1, VALUES(date, country = "FR"))

Best.

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

 

=
NETWORKDAYS (
    _startdate,
    _enddate,
    1,
    DISTINCT (
        SELECTCOLUMNS ( FILTER ( 'Holidays', [country] = "FR"),"Date",[date] ) )
    )
)

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

 

=
NETWORKDAYS (
    _startdate,
    _enddate,
    1,
    DISTINCT (
        SELECTCOLUMNS ( FILTER ( 'Holidays', [country] = "FR"),"Date",[date] ) )
    )
)

Just trying your solution and it works well. Little bit tricky but I will remember the tips.

thanks a lot for your help 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.