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

Conditional Formatting a Matrix with multiple columns

Hi, 

I have a matrix table in pbi and I want comparing for each company (LOB) which product is the max %.

Something like this:

 

melimob1_0-1732202204431.png

 

I have a summary table where there is a column to denote by LOB and product, which is the dominant.

I'm stuck on creating the conditional format to apply as a field rule however.

would be grateful for any advice?

 

many thanks

 

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Super User
Super User

Hi @melimob1 ,

If i understood well, you need to create a measure to rank the countries, something like this:

Rank = 
RANKX(
    ALL(financials[Country]),
    [Sales Mix %],
    ,DESC
)

 

Now you can add a background color using conditional format to your % column as shown bellow:

Bibiano_Geraldo_0-1732217195696.png

 

Use these rules and click OK:

Bibiano_Geraldo_1-1732217373802.png

 

Now your result should look like this:

Bibiano_Geraldo_2-1732217439914.png

 

 

View solution in original post

5 REPLIES 5
Bibiano_Geraldo
Super User
Super User

Hi @melimob1 ,

If i understood well, you need to create a measure to rank the countries, something like this:

Rank = 
RANKX(
    ALL(financials[Country]),
    [Sales Mix %],
    ,DESC
)

 

Now you can add a background color using conditional format to your % column as shown bellow:

Bibiano_Geraldo_0-1732217195696.png

 

Use these rules and click OK:

Bibiano_Geraldo_1-1732217373802.png

 

Now your result should look like this:

Bibiano_Geraldo_2-1732217439914.png

 

 

that dear friend is a beautiful thing!!! 
worked like a charm first time (I just change the field I wanted to rank against). 

I can't thank you enough, finally... something was simple 😉 

ps.  I will post something else if I need to but in another matrix, I also need to colour code one column if the value on that row doesn't match with another colum (same row).. shall I do a new post for tracking? or is this something easy?

Happy that it worked,
If your create a post, just @me to to let me know and dont forget to show your expected results in the post.

 

Thank you.

 

hey, I got fancy also as used your rank measure just to show an icon for the top as well as colour! thank you again!

😀😀😀The sky is limit.

 

 

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.