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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
jimbob2285
Advocate II
Advocate II

Matrix, Cell Element, Background Conditional Formatting - don't apply to column totals

I have a matrix, whose rows show types of quotes with a total quotes below (row totals) and the columns are lead times and the values are the number of quotes

 

I want to conditionally format columns that are past their lead time in red and those that are not yet due in green.  I can;t apply conditional formatting to specific columns because it's a matrix, not a table - So I'm applying background conditional formatting to cell elements instead.  I'm also applying them to Values & Totals so that the row totals at the bottom of the grid are also colour coded the same.

 

Which seems to be working fine, until we look at the column totals... and the subtotals are conditionally formatted, which is fine, but so is the grand total, and I don't want it to be - but I can't find a way not to have the grand totals unformatted, as they're currently green, indicating it's a good number, when in fact it's a combination of a bad and good number (bad being overdue, good being not yet due)

 

It's probably easier to look at the images below - it;s the grand total on the far RHS ofthe matrix, that I don;t want conditionally formatted... and what decided it should be green, rather than red:

Matrix.pngFormatting.png

1 ACCEPTED SOLUTION
AndrewGould
Frequent Visitor

Hi,

Can you do this with a measure?  Here's a basic example:

 

Cell Colour = SWITCH(
    TRUE(),
    SELECTEDVALUE('QCD Period L2'[QCD Period L2]) = "Today", "Yellow",
    SELECTEDVALUE('QCD Period L2'[QCD Period L2]) = "1 Month + Past QCD", "Grey",
    CONTAINSSTRING(SELECTEDVALUE('QCD Period L2'[QCD Period L2]), "-"), "Red",
    CONTAINSSTRING(SELECTEDVALUE('QCD Period L2'[QCD Period L2]), "+"), "Green",
    SELECTEDVALUE('QCD Days'[QCD Days]) = "Past QCD", "Red",
    SELECTEDVALUE('QCD Days'[QCD Days]) = "Due", "Green"
)
 
You could then assign this to the Background Color conditional format rather than using the rules you defined
 
AndrewGould_0-1722531591367.png

 

And the result (sorry about the gross colours!):

AndrewGould_1-1722531619192.png

 

 

View solution in original post

3 REPLIES 3
AndrewGould
Frequent Visitor

Hi,

Can you do this with a measure?  Here's a basic example:

 

Cell Colour = SWITCH(
    TRUE(),
    SELECTEDVALUE('QCD Period L2'[QCD Period L2]) = "Today", "Yellow",
    SELECTEDVALUE('QCD Period L2'[QCD Period L2]) = "1 Month + Past QCD", "Grey",
    CONTAINSSTRING(SELECTEDVALUE('QCD Period L2'[QCD Period L2]), "-"), "Red",
    CONTAINSSTRING(SELECTEDVALUE('QCD Period L2'[QCD Period L2]), "+"), "Green",
    SELECTEDVALUE('QCD Days'[QCD Days]) = "Past QCD", "Red",
    SELECTEDVALUE('QCD Days'[QCD Days]) = "Due", "Green"
)
 
You could then assign this to the Background Color conditional format rather than using the rules you defined
 
AndrewGould_0-1722531591367.png

 

And the result (sorry about the gross colours!):

AndrewGould_1-1722531619192.png

 

 

Thanks Andrew, I thought about using a measure, but couldn't see how it would produce a different result - I would have never got there without your help and didn;t realise you could apply the measure to different levels within the matrix

Excellent, happy to hear that it helped!

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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