Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
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")
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")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |