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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
travelsandbooks
Frequent Visitor

Using OR condition between >2 slicers, and slicing even if not all slicers are active

I want to be able to filter my visuals based on whether any of my multiple slicers are active. 

 

I have been able to display data fitting any of the values in my slicers (rather than all of them) using this guide: https://apexinsights.net/blog/or-xor-slicing -- I just rewrote the OR filter to include multiple conditions:

 

OR Filter = 
IF (
    SELECTEDVALUE ( 'Table1'[Col1] )   IN ALLSELECTED ( xCol1[Col1] ) ||
    SELECTEDVALUE ( 'Table2'[Col2] )   IN ALLSELECTED ( xCol2[Col2] ) ||
    SELECTEDVALUE ( 'Table1'[Col3] )   IN ALLSELECTED ( xCol3[Col3] ),
    1,
    0
)

 

My problem is that I want to be able to have fewer than three slicers active and for the data to still be filtered. At the moment, if only two of the slicers are active, it still brings in everything. The data is only filtered if all three slicers are active.

 

Can anyone help?

1 ACCEPTED SOLUTION
marcelsmaglhaes
Super User
Super User

Hi @travelsandbooks 

To achieve the desired behavior where your visuals filter based on any of the slicers being active, not requiring all slicers to be active simultaneously, maybe you can try modify your DAX like bellow.

OR Filter =
IF (
(
ISFILTERED(xCol1[Col1]) &&
SELECTEDVALUE('Table1'[Col1]) IN VALUES(xCol1[Col1])
) ||
(
ISFILTERED(xCol2[Col2]) &&
SELECTEDVALUE('Table2'[Col2]) IN VALUES(xCol2[Col2])
) ||
(
ISFILTERED(xCol3[Col3]) &&
SELECTEDVALUE('Table1'[Col3]) IN VALUES(xCol3[Col3])
),
1,
0
)

Let me know if that helps.


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



View solution in original post

2 REPLIES 2
travelsandbooks
Frequent Visitor

I'm trying to do this, but when I try and do it, the filter is greyed out when I try and apply it to the visual. How do I resolve that? Thank you!

marcelsmaglhaes
Super User
Super User

Hi @travelsandbooks 

To achieve the desired behavior where your visuals filter based on any of the slicers being active, not requiring all slicers to be active simultaneously, maybe you can try modify your DAX like bellow.

OR Filter =
IF (
(
ISFILTERED(xCol1[Col1]) &&
SELECTEDVALUE('Table1'[Col1]) IN VALUES(xCol1[Col1])
) ||
(
ISFILTERED(xCol2[Col2]) &&
SELECTEDVALUE('Table2'[Col2]) IN VALUES(xCol2[Col2])
) ||
(
ISFILTERED(xCol3[Col3]) &&
SELECTEDVALUE('Table1'[Col3]) IN VALUES(xCol3[Col3])
),
1,
0
)

Let me know if that helps.


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors