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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
PaulHallam
Helper III
Helper III

Exclude bank holidays selected from slicer, from a separate date slicer

Hi All,
I have a 'Date' table with all dates 2024.
I have a 'BankHolidayDates' table with all bank holiday dates 2024

I want a date slicer on report page that includes all dates from the 'Date' table
I want a bank holidays date slicer on report page that includes all dates from the 'BankHolidayDates' table


When i select an item in the 'BankHolidaysDates' slicer i want it removed from the Date slicer.

So effectively the 'BankHolidaysDates' slicers title will be "Exclude Bank Holidays" with a select all option to remove all

Any one got any ideas?

Thanks

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @PaulHallam ,

Please make sure there is no relationship between the two date tables:

vjunyantmsft_4-1738222723085.png


Please use this DAX to create a measure:

Filter = 
IF(
    ISFILTERED(BankHolidaysTable[Date]),
    IF(
        MAX('Calendar'[Date]) IN VALUES(BankHolidaysTable[Date]),
        0,
        1
    ),
    1
)

Set it up as shown below:

vjunyantmsft_0-1738222540013.png

And the final output is as below:

vjunyantmsft_1-1738222582950.png

vjunyantmsft_2-1738222595097.png

vjunyantmsft_3-1738222643232.png


Best Regards,
Dino Tao
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

7 REPLIES 7
v-junyant-msft
Community Support
Community Support

Hi @PaulHallam ,

Please make sure there is no relationship between the two date tables:

vjunyantmsft_4-1738222723085.png


Please use this DAX to create a measure:

Filter = 
IF(
    ISFILTERED(BankHolidaysTable[Date]),
    IF(
        MAX('Calendar'[Date]) IN VALUES(BankHolidaysTable[Date]),
        0,
        1
    ),
    1
)

Set it up as shown below:

vjunyantmsft_0-1738222540013.png

And the final output is as below:

vjunyantmsft_1-1738222582950.png

vjunyantmsft_2-1738222595097.png

vjunyantmsft_3-1738222643232.png


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

Thanks Dino. This will achieve what i need, but doesnt work with the select all filter

Hi @PaulHallam ,

This may be a limitation of the "Select all" option in the slicer itself, because the "Select all" option itself does not exist in your data column. When you select "Select all", although the slicer will work, DAX cannot recognize which data you have selected.

Best Regards,
Dino Tao

Hi @PaulHallam,

 

Please try the following:

In your 'BankHolidayDates' table create a column which is always equal to 1.
In your 'Date' table create a calculated column as follow

IsBankHoliday = 
IF(
    CONTAINS(Holidays, Holidays[Date], Dates[Date]),
    0, 
    1
)


Create a relationship btw the two tables as follow:

MattiaFratello_0-1738162098224.png

 

MattiaFratello_1-1738162126602.png


Let me know if this helped,
All the best

 

Hi Mattia, i had already tried soemthing similar and this doesnt seem to work. Linking the 'is holiday' columns would be a many to many relationship. 
I need to Slice bank holidays out of the main dates slicer, what you have shown is not this case

Greg_Deckler
Super User
Super User

@PaulHallam Sounds like you need a complex selector. https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M5...

 

Basically, check if you have a single value for BankHolidaysDates. Check if the current date is the selected date and if so return 0, otherwise 1. Filter out the 0's in your Filter pane for that visual using the measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

Well complex was the word......! I cant seem to get it to work as i can't get the use case/fields to match my case.
Below is the use case (image)

PaulHallam_0-1738169133159.png

 

These are the tables if anyone wants to have a go, it would very much be appreciated.

 

BankHolidaysTable

01 January 2024New Year’s Day
29 March 2024Good Friday
01 April 2024Easter Monday
06 May 2024Early May bank holiday
27 May 2024Spring bank holiday
26 August 2024Summer bank holiday
25 December 2024Christmas Day
26 December 2025Boxing Day


DatesTable 

= List.Dates( #date(2024,01,01), 366, #duration(1,0,0,0))



Any help much appreciated.

Paul

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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