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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dillard70
Regular Visitor

How to use two different fields in one filter

I would like to take two or more different fields and put them in one "advanced" filter with a "contains X or X".

 

For example, let's say I have a spreadsheet with 4 columns: unique name of a person, what make of car they drive (Chevrolet, Ford, Honda, etc.), what kind of motorcylce they drive (Honda, Harley, etc.), and what method of public transportation they use (bus, subway, Uber, etc.) In a pool of 1,000+, some people may have only one answer (only drive a car), some may have none (only walk), and some may have multiple (own a Ford car and Honda bike, does not use public transportation). 

 

What I want to do with this data is to be able to filter out people who don't own a specific response in each category, but allow for them to be "false" in one column, but "true" in another and still report. For example: I want to show anyone who owns a Chevy or Ford car, and/or a Harley bike, and/or takes the bus. So, if I filter out anyone who doesn't drive a Chevy or Ford car, the report will not show people who have a Honda car but do own a Harley bike. If I filter each of these values to only show who owns each of these specific responses, it will only show people who selected all three, and not those who only selected one or two but not all. 

1 ACCEPTED SOLUTION
th3h0bb5
Resolver II
Resolver II

DAX has an OR function. Use that to create boolean answers to whatever question you want to answer.

 

So for your example,  "I want to show anyone who owns a Chevy or Ford car, and/or a Harley bike, and/or takes the bus."

 

you can create True/False statements as filters combining AND and OR statements. So something along these lines:

 

(A = "Chevy" OR "Ford") OR (B = "Harley") OR (C = "Bus")

 

As long as one of these things is true, the whole statement will return TRUE. If you want to see people who have a Chevy or Ford and drive the bus, just change an OR to an AND:

 

(A = "Chevy" OR "Ford") AND (C = "Bus")

View solution in original post

1 REPLY 1
th3h0bb5
Resolver II
Resolver II

DAX has an OR function. Use that to create boolean answers to whatever question you want to answer.

 

So for your example,  "I want to show anyone who owns a Chevy or Ford car, and/or a Harley bike, and/or takes the bus."

 

you can create True/False statements as filters combining AND and OR statements. So something along these lines:

 

(A = "Chevy" OR "Ford") OR (B = "Harley") OR (C = "Bus")

 

As long as one of these things is true, the whole statement will return TRUE. If you want to see people who have a Chevy or Ford and drive the bus, just change an OR to an AND:

 

(A = "Chevy" OR "Ford") AND (C = "Bus")

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.