cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: How to use two different fields in one filter

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
Highlighted
Resolver II
Resolver II

Re: How to use two different fields in one filter

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

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors