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

Color cell in table view

Hi 

 

I have created one Power BI report and I am showing up one table view in my report. There is one column in my table which is holding values as "R", "G" and "Y" and I want to show "R" cell with RED background color, "G" with Green color and cell with "Y" value with Yellow color as Backgroud color. Is this possible ?

 

5.png

1 ACCEPTED SOLUTION
rocky09
Solution Sage
Solution Sage

Make sure you have latest Power BI Installed.

 

1. Create a Custom Column and assign the Color Codes by using Switch function. Example:

ColorCodes = SWITCH(TRUE(),
            Table1[Color Symbol] = "B", "#0000FF",
            Table1[Color Symbol] = "R", "#FF0000",
            Table1[Color Symbol] = "G", "#008000",
            Table1[Color Symbol] = "Y", "#FFFF00")

2. Go to formatting Tab, select Conditional Formatting and then Select Background and then Select Field Value and then Select ColorCodes Column from the list. I.e.

solution.PNG

 

View solution in original post

4 REPLIES 4
emembreno81
Frequent Visitor

is there a way to do this formula for multiple columns?  My example is that I've created a series of columns that all show either a task as "COMPLETE" or "INCOMPLETE".  I want any instance with "INCOMPLETE" to be shown as a red box across a series of 2-6 columns.  Is this something that is do-able?

rocky09
Solution Sage
Solution Sage

Make sure you have latest Power BI Installed.

 

1. Create a Custom Column and assign the Color Codes by using Switch function. Example:

ColorCodes = SWITCH(TRUE(),
            Table1[Color Symbol] = "B", "#0000FF",
            Table1[Color Symbol] = "R", "#FF0000",
            Table1[Color Symbol] = "G", "#008000",
            Table1[Color Symbol] = "Y", "#FFFF00")

2. Go to formatting Tab, select Conditional Formatting and then Select Background and then Select Field Value and then Select ColorCodes Column from the list. I.e.

solution.PNG

 

@rocky09 thank you for your answer. I believe that is exactly what I need as well. However, I am so new to PowerBI, I don't even know where to put that DAX code. Can you provide some more detailed steps to implement your answer. I believe I can figure out how to add the column in the table. But some more on that might be helpful as well. Piecing all this together off YouTube videos and forum posts has been rough. Thank you!

Militambe3171
Frequent Visitor

Step 1 Create custom column assign value(numeric 1=red, 2=green, 3=yellow to them using conditional column (for e.g. new column name "index")

Step 2 once created select column which you want to format

 

Step 3 go to conditional formating >> backgroung formating >> formating applies to  (select column)

 

Step 4 colors by rule

 

1 is red

2 is green

3 is yellow

 

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.