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
em12340
Frequent Visitor

Background Color Change based upon Value

Hi PowerBi Community,

 

I have a matrix table that where the values are colour coded based on three categories Engagement, Known, and Outcomes, I am able to colour code the values but for the cells that have no value dont get colour coded since they dont contain any data. Is there a way i can colour code them as well? Thanks in advance ! 

Capture4.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

 

Hi,

 

just make a new column with similar concept as explained below( you have to apply either if or switch function) :-

 

I'm using IF condition/function

 

 New_Column = if([category = "engagement" , 1,
                                if(([category = "Known", 2,
                                    if(([category = "Outcomes", 3,0))

Now go to condition backgroubd formating (click on field column in which you want to do background formatting)

Please see the below picture

Capture 2.PNG

 

Now in the conditional background formating use the new column to make the rules.

Select Format BY to rules

Select based on Field to New_Column

 

Capture 3.PNG

 

 

YOU WILL GET SIMILAR RESULT AS BELOW:

Capture 4.PNG

 

 

HOPE THIS WILL HELP

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

 

 

Hi,

 

just make a new column with similar concept as explained below( you have to apply either if or switch function) :-

 

I'm using IF condition/function

 

 New_Column = if([category = "engagement" , 1,
                                if(([category = "Known", 2,
                                    if(([category = "Outcomes", 3,0))

Now go to condition backgroubd formating (click on field column in which you want to do background formatting)

Please see the below picture

Capture 2.PNG

 

Now in the conditional background formating use the new column to make the rules.

Select Format BY to rules

Select based on Field to New_Column

 

Capture 3.PNG

 

 

YOU WILL GET SIMILAR RESULT AS BELOW:

Capture 4.PNG

 

 

HOPE THIS WILL HELP

parry2k
Super User
Super User

@em12340  you should be able to do so, could you provide info how you are using backgroun colors now since there are many ways to do so, it will help to provide the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

i have a measure written like this,

SWITCH(TRUE(), MAX(Engagement[Type]) = "Outcome",1,MAX(Engagement[Type]) = "Known",2,MAX(Engagement[Type]) = "Engagement",3)
and i wouldve asssumed this would have colour coloded all values under those cateogry, but wher there are blanks there is
no data so it doesnt colour code it , thats the problem i am having

@em12340  may be add final condition when it is not any of those values

 

SWITCH(TRUE(), 
MAX(Engagement[Type]) = "Outcome",1,
MAX(Engagement[Type]) = "Known",2,
MAX(Engagement[Type]) = "Engagement",3,
4)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

that would work although i would want them to colour code in the category they are in, so for instance you can see "Auckland Regions" has some blanks and it comes under the category known,so i would want them to be colour coded orange. as you see in the picture below i have blanks for the category Engagements therefore , for all the blanks they should be coloured blue 

 

Capture23.JPG

or is there a way to just make everything under the Column "Engagement" blue and everythingunder the Column "Known" Orange and everything under the column "Known" Purple? 

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.