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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Using OR to filter a visual using two fields

Hi,

 

I am trying to filter a visual based on two fields but at the moment once the first one is applied the 2nd is restricted. 

 

I want the table to list values when either SOS = 22/23 OR PC = 22/23

FarhadA_0-1652801923415.png

 

At the moment once a select the first then the second is select is reduced. 

 

These are Dax calender tables.

 

Any help is much appricated.

 

Thank You

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Here is one way. Create duplicates of the tables and leave them unrelated in the model. Use the fields of these unrelated tables as the slicers.

model.png

 

Then create the equivalent measure to use as a filter for the visual, setting the value to 1:

 

Filter Table =
SWITCH (
    TRUE (),
    AND (
        ISFILTERED ( PC ),
        MAX ( 'Table'[PC Format] ) IN VALUES ( PC[PC Format] )
    ), 1,
    AND (
        ISFILTERED ( SOS ),
        MAX ( 'Table'[SOS Format] ) IN VALUES ( SOS[SOS Format] )
    ), 1,
    AND ( NOT ( ISFILTERED ( PC ) ), NOT ( ISFILTERED ( SOS ) ) ), 1
)

 

FT.gif

 

I've attached a sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

5 REPLIES 5
PaulDBrown
Community Champion
Community Champion

Can you try again? I actually edited the post and you may have tried while I was editing it

EDIT: I just tried the download and it works for me





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






PaulDBrown
Community Champion
Community Champion

Here is one way. Create duplicates of the tables and leave them unrelated in the model. Use the fields of these unrelated tables as the slicers.

model.png

 

Then create the equivalent measure to use as a filter for the visual, setting the value to 1:

 

Filter Table =
SWITCH (
    TRUE (),
    AND (
        ISFILTERED ( PC ),
        MAX ( 'Table'[PC Format] ) IN VALUES ( PC[PC Format] )
    ), 1,
    AND (
        ISFILTERED ( SOS ),
        MAX ( 'Table'[SOS Format] ) IN VALUES ( SOS[SOS Format] )
    ), 1,
    AND ( NOT ( ISFILTERED ( PC ) ), NOT ( ISFILTERED ( SOS ) ) ), 1
)

 

FT.gif

 

I've attached a sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Thank you, 

 

I tried to downloand the file but that doesn't seem to work, are you able to reupload it?

Anonymous
Not applicable

I'm unable to call the date table as they are Dax tables

FarhadA_0-1652807063721.png

 

amitchandak
Super User
Super User

@Anonymous , You need to create measures for that

 

example

countrows(filter(Table, Table[SOS] = "22/23" || Table[PC] = "22/23"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.