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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

5 REPLIES 5
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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