Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
melimob1
Helper I
Helper I

Matrix to show % of row by Category and % sub category split

Hi,  appreciate any help.

 

Frustrating thing is, I HAD this WORKING... and now it's not and I can't figure out why.  

 

I have built a matrix which looks something like this.

melimob1_1-1732149708374.png

 

 

For each country, I need to compare Company A to see which product has the highest %, and do the same for company B.

Intention is, conditional formatting will highlight which is highest for each so can see product and company to see patterns.

 

 

To work out % total by LOB I had these measures:

 

TRX = SUM(TABLE1[NET_TICKETS])
 
then another measure:
 
TRX TTL (LOB) =
CALCULATE(
    SUM('TABLE1'[NET_TICKETS]),
    REMOVEFILTERS(TABLE1[Product (groups)]
))
 
and % measure is:
% TRX =
DIVIDE([TRX], [TRX TTL (LOB)])
 
this was all working fine until I wanted to sort the products in a different order so had to edit my query, merged with a lookup table to add grouping and sort order so I can sort by another column in the table.
Went back to my matrix visual and now all my percentages show 100% no matter what I try!!
 
Once (if), I fix the %'s, I would also like advice on how to do the conditional format so that for each row, I am comparing only the %'s for products for one company at a time.
I.e. Argentina for Company A would be red for lowest % under oranges, med yellow for apples and high green for pears. 
Argentina for  Company B would be whichever red, yellow green % for them. etc. 
 
Lastly (but I can live without it and just do a seperate table), but I have a sub category which I would like to split the % based on trx for the parent category as per above. 
 
I found somehting on google when I was searching for a fix for the above but it didn't work (still shows 100%) for all. but to be honest, I'm not really understanding what I'm doing..
 
%  TRX =
VAR PercentCat =
    SUM (TABLE1[NET_TICKETS])
        / CALCULATE( SUM( TABLE1[NET_TICKETS]), ALL('TABLE1[Product (groups)])
VAR PercentSubCat =
    SUM (TABLE1[NET_TICKETS])
        / CALCULATE( SUM(TABLE1[NET_TICKETS]), ALL(TABLE1[SubCat]))
RETURN
    IF(ISINSCOPE(TABLE1[SubCat]),PercentSubCat,PercentCat)
 
 As I say, I'm really at the end of my thether - have worked on this for hours so really appreciate any help.
 
many thanks
1 REPLY 1
Bmejia
Super User
Super User

Try updating the total measure as follows using ALLEXCEMPT on POS_COUNTRY

TRX TTL (LOB) =
CALCULATE(
SUM('TABLE1'[NET_TICKETS]),
AllEXEMPT(TABLE1[POS_COUNTRY]
))

 

Also i am assuming you are using a sort table, so make sure you use the product column in the columns section in your matrix rather then the one from the original table.

Bmejia_2-1732225988271.png

 

Bmejia_1-1732225813365.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.