Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I've created a measure to sum my values grouped by 2 categories using the SUM and ALLEXCEPT functions, however it's not calculating the numbers as expected.
Table
| Category2 | Category1 | ProductID | Sales |
| 1 | Bag | ABC123 | 100 |
| 2 | Bag | ABC123 | 200 |
| 1 | Bag | XYZ456 | 300 |
| 2 | Bag | XYZ456 | 400 |
| 1 | Shoes | DEF567 | 800 |
| 2 | Shoes | DEF567 | 700 |
Measure = CALCULATE(SUM(Value)),ALLEXCEPT(Table,[Category1],[Category2]))
When I put the values into the table and include category 2, the correct value is calculated. However, when I remove category2 from the table, the figures change. I would've expected the grouped sum up to category2 to remain but it doesn't.
How can amend my measure to display the expected outcome below?
Current outcome (incorrect)
Exected outcome
| Category1 | ProductID | Sales | Measure |
| 1 | ABC123 | 100 | 400 |
| 2 | ABC123 | 200 | 600 |
| 1 | XYZ456 | 300 | 400 |
| 2 | XYZ456 | 400 | 600 |
| 1 | DEF567 | 800 | 800 |
| 2 | DEF567 | 700 | 700 |
Hi @bo_afk,
Can you please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hello @bo_afk ,
You better create column instead of measure and try,
Hi @Anonymous, thanks for the suggestion. This does seem to work however this doesn't dynamically calculate if I apply other filters in the report. Am I really unable to create this as a measure so that the figure changes with filters?
Hi @amitchandak, thanks for your suggestion. Unfortunately this hasnt completely worked. It sums it up by productID but not by category 2.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 46 | |
| 44 |