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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AliPoTD
Advocate II
Advocate II

How to colour sub-total rows of a matrix visual without affecting the entire column

Hello,

 

I suspect this has a straightforward answer but I'm going round in circles! Hopefully someone can help.

 

I have a matrix table and am using row sub-totals.

I only want one of the rows to have a sub-total and am getting this to show as desired.

The issue I have is using a background colour to show the sub-total row.

If I opt to have a background colour, it hightlights all the columns as well, which I don't want. 

I only want the sub-total row to be highlighted in a different colour; how can I achieve this please?

 

For example:

Turning on the sub-total row for the column without applying to labels shows this (ignore grey boxes, used to hide personal data):

AliPoTD_0-1740650988908.png

But I want the green background to extend to show from the word "Total". If I select "Apply to labels", i get this:

AliPoTD_1-1740651218979.png

I don't want the entire columns to be green, only the sub-total row.

How can I achieve this please?

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @AliPoTD 

 

You can  write a measure to conditionally format just the subtotals. Example:

conditional formatting color =
IF (
    NOT ( inscope ( table[column in the lowest level of the hierarchy] ) ),
    "color"
)

Replace color with RGB, RGBA, HEX or basic colors like green or red. Choose field value from the conditional formatting option and select this measure.

 

Please note that conditional formatting applies to values section of the matrix only and does not extend to the row or column categories. Othere than this, there is no other way to color just the subtotals.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @AliPoTD 

 

You can  write a measure to conditionally format just the subtotals. Example:

conditional formatting color =
IF (
    NOT ( inscope ( table[column in the lowest level of the hierarchy] ) ),
    "color"
)

Replace color with RGB, RGBA, HEX or basic colors like green or red. Choose field value from the conditional formatting option and select this measure.

 

Please note that conditional formatting applies to values section of the matrix only and does not extend to the row or column categories. Othere than this, there is no other way to color just the subtotals.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Many thanks for getting back to me. Understood. Unfortunately my issue does not relate to the Value but to the Row data, so I can't use conditional formatting.

Ah well, I've learned something new at least!

Thanks for your help.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.