Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
Looking to compare the sales of two products. I want to be able to compare the total and average unit sales for stores that sell Product A only, stores that sell Product B only, and stores that sell both Product A and B. I am stuck determining the best custom measure that can filter for both the store and the product. Any insight?
I also wanted to see the distinct count of stores that sell each product and successfully wrote a customer measure for stores that sell Product A only and Product B only, but the function did not work when I tried to filter for both in one measure:
"Count of A & B Stores = CALCULATE(DISTINCTCOUNT('Portal Data'[Store]),FILTER('Portal Data',[Description]="SAUERKRAUT A" && [Description]="SAUERKRAUT B"))
How did I go wrong here? The card read the measure as Blank.
Thanks for helping us become Power BI Wizards!
Solved! Go to Solution.
@thebrinery,
I make a test using the following sample data, and create the measures below.
Count of A&B stores = CALCULATE(DISTINCTCOUNT('Portal Data'[Store]),FILTER('Portal Data','Portal Data'[Description]="SAUERKRAUT A" || 'Portal Data'[Description]="SAUERKRAUT B"))
total sales = CALCULATE(SUM('Portal Data'[Sales]),FILTER('Portal Data','Portal Data'[Description]="SAUERKRAUT A" || 'Portal Data'[Description]="SAUERKRAUT B"))
average sales = [total sales]/[Count of A&B stores]
If the above DAX don’t help, please share sample data of your table and post expected result here. Do mask sensitive data before you uploading sample data.
Regards,
Lydia
@thebrinery,
I make a test using the following sample data, and create the measures below.
Count of A&B stores = CALCULATE(DISTINCTCOUNT('Portal Data'[Store]),FILTER('Portal Data','Portal Data'[Description]="SAUERKRAUT A" || 'Portal Data'[Description]="SAUERKRAUT B"))
total sales = CALCULATE(SUM('Portal Data'[Sales]),FILTER('Portal Data','Portal Data'[Description]="SAUERKRAUT A" || 'Portal Data'[Description]="SAUERKRAUT B"))
average sales = [total sales]/[Count of A&B stores]
If the above DAX don’t help, please share sample data of your table and post expected result here. Do mask sensitive data before you uploading sample data.
Regards,
Lydia
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
60 | |
58 | |
54 | |
36 | |
33 |
User | Count |
---|---|
79 | |
66 | |
45 | |
44 | |
42 |