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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JC2022
Helper III
Helper III

Exclude dates from another table

Hi, 

If I have the formula below but I would like to exclude the dates that are in my Holidays table (a different table). How do I do this?

=
SUMX (
    Schedule,
    SUMX (
        FILTER (
            Hours,
            Hours[Schedule ID] = Schedule[Schedule ID]
                && Hours[Date] >= Schedule[From Date]
                && Hours[Date] <= Schedule[To Date]
        ),
        Schedule[Hours]
    )
)

  

1 ACCEPTED SOLUTION

@JC2022 
Just add 0 like:

=
SUMX (
    Schedule,
    SUMX (
        FILTER (
            Hours,
            Hours[Schedule ID] = Schedule[Schedule ID]
                && Hours[Date] >= Schedule[From Date]
                && Hours[Date] <= Schedule[To Date]
                && NOT ( Hours[Date] IN VALUES ( Holidays[Date] ) )
        ),
        Hours[Hours]
    )
) + 0

View solution in original post

5 REPLIES 5
rautaniket0077
Resolver I
Resolver I

Hi @JC2022,
you can use the below dax to exclude or include date.

rautaniket0077_0-1669713885824.png

The Date column used in above table is from Holiday Table and if these dates are there is Orders table then are "Included" else "Excluded"

Please accept my answer as solution if it solves your issue.

 

tamerj1
Super User
Super User

Hi @JC2022 
Please try

=
SUMX (
    Schedule,
    SUMX (
        FILTER (
            Hours,
            Hours[Schedule ID] = Schedule[Schedule ID]
                && Hours[Date] >= Schedule[From Date]
                && Hours[Date] <= Schedule[To Date]
                && NOT ( Hours[Date] IN VALUES ( Holidays[Date] ) )
        ),
        Hours[Hours]
    )
)

Hi @tamerj1 

this is indeed excluding the dates, so it is not even showing the dates anymore. It's probably visually better to still show these dates but just return 0hours on these holiday dates. 

What do you think? and how to do this?

@JC2022 
Just add 0 like:

=
SUMX (
    Schedule,
    SUMX (
        FILTER (
            Hours,
            Hours[Schedule ID] = Schedule[Schedule ID]
                && Hours[Date] >= Schedule[From Date]
                && Hours[Date] <= Schedule[To Date]
                && NOT ( Hours[Date] IN VALUES ( Holidays[Date] ) )
        ),
        Hours[Hours]
    )
) + 0

Perfect!

Many thanks!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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