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.
Hello!
I have three product SKU categories (A, B, C) and would like to divide the total sales of each of categories A and B by one selected category (C). I have created the following measure in DAX:
It is calculating the sales of A, B and C categories divided by C. Is there a way to exclude C category from being calculated in the result? It's always going to show 100%...
See attached screenshot:
Solved! Go to Solution.
Here a few steps in oder to solve your problem. hope this helps:
Current Measure Logic:
Excluding Category C:
Solution Approach:
Potential Solutions:
Outcome:
In short, modify the measure logic to exclude category C during the calculation, ensuring it does not impact the result.
% Sales on C =
var _category = SELECTEDVALUE('Won Quotes w Line Items from 2023 - PBI'[SKU Category])
var _value = SELECTEDVALUE('Won Quotes w Line Items from 2023 - PBI'[Quote Line Item: Total Price (converted).amount])
var _total = [Total C Sales]
-- Check if the selected category is not "C" and perform the division only for A and B
var _result = IF(_category <> "C", DIVIDE(_value, _total, ""), BLANK())
return _result
Thank you very much, that worked like a charm!
Here a few steps in oder to solve your problem. hope this helps:
Current Measure Logic:
Excluding Category C:
Solution Approach:
Potential Solutions:
Outcome:
In short, modify the measure logic to exclude category C during the calculation, ensuring it does not impact the result.
% Sales on C =
var _category = SELECTEDVALUE('Won Quotes w Line Items from 2023 - PBI'[SKU Category])
var _value = SELECTEDVALUE('Won Quotes w Line Items from 2023 - PBI'[Quote Line Item: Total Price (converted).amount])
var _total = [Total C Sales]
-- Check if the selected category is not "C" and perform the division only for A and B
var _result = IF(_category <> "C", DIVIDE(_value, _total, ""), BLANK())
return _result
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 |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |