- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Filter by Multiple Column Value Conditions
Hi There,
I've been struggling with this for hours and can not figure a solution. Any help greatly appreciated.
I have a data set like the below. What I need to do via DAX (I'm trying to work in PowerPivot) is to exclude any City/State that is not in both retailers. Or to say, both retailers must be in the City/State for that City/State to remain in the data set.
Tried regular value filters in the pivot table (less than 0) and that did not work, so thinking I need to filter via the data model in Power Pivot.
So for the example below, I would exclude both Springfield, ID (only Retailer A is located here) and Phoenix, AZ (only Retailer B is located here).
Data Set:
Retailer | City, State | Month | Sales |
Retailer A | Los Angeles, CA | 1/1/2024 | 100 |
Retailer A | Las Vegas, NV | 1/1/2024 | 200 |
Retailer A | Springfield, IL | 1/1/2024 | 100 |
Retailer A | Springfield, ID | 1/1/2024 | 100 |
Retailer B | Los Angeles, CA | 1/1/2024 | 200 |
Retailer B | Las Vegas, NV | 1/1/2024 | 100 |
Retailer B | Springfield, IL | 1/1/2024 | 200 |
Retailer B | Phoenix, AZ | 1/1/2024 | 100 |
Desired Output:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I produced your required output as follows:
An example of the dax formulae to achive this output is as follows:
Where the data model looks like below:
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can consider using PRODUCTX and throwing away the BLANK() results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not familiar with PRODUCTX and the below solution from @DataNinja777 worked great. However, I will spend some time exploring this avenue as well to improve my skills. Thank you for the suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I produced your required output as follows:
An example of the dax formulae to achive this output is as follows:
Where the data model looks like below:
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fantastic, thank you so much.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
06-26-2022 08:00 AM | |||
Anonymous
| 01-31-2023 12:10 AM | ||
08-08-2024 07:49 AM | |||
04-16-2024 06:28 AM | |||
10-07-2023 08:15 AM |
User | Count |
---|---|
14 | |
14 | |
11 | |
11 | |
8 |