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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Different Conditional Formatting for Values and Totals on the Same Visual

Hello guys,

I have a matrix table with the row and column subtotal done in Power BI. I want to set a conditional background formatting for my values and total. The issue is that the taget of my values are different from the target of my totals. So, how do I achieve this? 

 

This is a random example of my matrix:

CategoryChina Japan Total
Product xx98.5%98.4%98.4%
Product yy97.3%98.2%97.9%
Total95.4%97.5%96.5%

 

What I want to achieve is the following:

1. If China value is => 98.8%, green else red

2. If Japan value is => 98.6%, green else red

3. If the total (column total) of China => 98.4%. green else red (Please, note that the total is generated in PBI)

4. If the total (column total) of Japan  => 98.4%. green else red (Please, note that the total is generated in PBI)

5. If the total (row total) of Product xx => 98.4%. green else red (Please, note that the total is generated in PBI)

5. If the total (row total) of Product yy => 98.4%. green else red (Please, note that the total is generated in PBI)

 

Please, how do I go about this? Is it possible to apply 2 different conditional formattings to the same visual (one for values and the second for totals)?

1 ACCEPTED SOLUTION

Would you be able to share the pbix file, if the data is not sensitive? Or else, the following video illustrates the concept, though the scenario is different

https://www.youtube.com/watch?v=s9ck7xx85mA

View solution in original post

6 REPLIES 6
jimbob2285
Advocate II
Advocate II

You can only apply one set of background conditional formatting rules, you can't apply two separate background conditional formatting rules, one for values and one for totals? 

Anonymous
Not applicable

Hey @Padycosmos .

The critical thing I'm finding hard to do at this point is how to apply these two measures (for values and the total) on the same visual. They overwrite one another (i.e. when I apply for value only, it works but when I go back to apply for totals only, the formats of values get removed). I don't if this is because of my limited knowledge in Power BI or that's just the way it is?

Would you be able to share the pbix file, if the data is not sensitive? Or else, the following video illustrates the concept, though the scenario is different

https://www.youtube.com/watch?v=s9ck7xx85mA

Anonymous
Not applicable

Hello @Padycosmos ,

Thanks for your response. However, the video only showed how to apply one format to either the values only, totals only or values and total. In my case one format is probably not applicable to both values and totals, as they have diferrent targets.

Please create 2 measures, apply one measure to values only and the other measure to Totals only. 

A sample measure is shown below:

Color =
VAR col = SWITCH(TRUE(),
CONTAINSSTRING(SELECTEDVALUE(Orders[Category]),"Fur")||CONTAINSSTRING(SELECTEDVALUE(Orders[Category]),"Off"),"Red",CONTAINSSTRING(SELECTEDVALUE(Orders[Category]),"Tech"),"Yellow")
RETURN
col
Padycosmos_0-1678373148688.png

 

Padycosmos_1-1678373204488.png

 

 

Padycosmos
Solution Sage
Solution Sage

Please create 2 measures , one for values and one for totals and use them in conditional formatting.

Tha following video will be of help:

https://www.youtube.com/watch?v=SfL3aniCl8o

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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