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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.