This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I am trying to create a custom calculation for my total column in a matrix and I'm not sure how to configure that best. My matrix looks like this currently, with the Groups being my rows and my Categories being my columns:
| Category 1 | Category 2 | Category 3 | |
| Group 1 | 0 | 5 | 12 |
| Group 2 | 5 | 9 | 15 |
| Group 3 | 12 | 2 | 17 |
| Group 4 | 7 | 0 | 20 |
What I am trying to calculate in my custom total column is the percentage of values that are in Category 3 for each group. In theory I want my matrix to look like this:
| Category 1 | Category 2 | Category 3 | % of Values that are in Category 3 | |
Group 1 | 0 | 5 | 12 | 70.588% |
| Group 2 | 5 | 9 | 15 | 51.724% |
| Group 3 | 12 | 2 | 17 | 54.839% |
| Group 4 | 7 | 0 | 20 | 74.074% |
I tried to create a measure that calculates this and it currently looks like this:
Hi @NJ81858 ,
According to your description, here are my steps you can follow as a solution.
(1) We can create a measure or calculated column.
Measure =
var _a=CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Group]),'Table'[Value]))
var _b=CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Category]="Category 3"))
var _c=DIVIDE(_b,_a,0)
return _cColumn = var _a = IF('Table'[Category]="Category 3",'Table'[value])
var _b = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Group]=EARLIER('Table'[Group])))
return DIVIDE(_a,_b,0)
(2) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 7 | |
| 6 | |
| 6 |