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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

different background color for each value

i want to add column in below table which should show different background color for each priorty . example it should show  green background for 0, orange for 1 and red for 2, the column should not show any data

 

powerbiexpert22_0-1731668966576.png

 

3 ACCEPTED SOLUTIONS
Angith_Nair
Continued Contributor
Continued Contributor

Hi @powerbiexpert22 

Create a measure that will display the priority. Apply background conditional formatting for this measure something like the below dax:

PriorityColor = 
SWITCH(
    TRUE(),
    TableName[Priority] = 0, "Green",
    TableName[Priority] = 1, "Orange",
    TableName[Priority] = 2, "Red",
    BLANK()
)

To ensure the column does not display any values make sure to format the text color to match the background color (via Conditional Formatting for text). Alternatively, make the font color transparent or very light so it blends with the table.

View solution in original post

Bibiano_Geraldo
Super User
Super User

Hi @powerbiexpert22,

Add a measure using the following DAX 

Priority Color = BLANK()

 

Now drag and drop the color measure to your Matrix, and add a conditional format as shown bellow:

Bibiano_Geraldo_0-1731672991889.png


Now configure the prompt screen to something like this and hit ok:

Bibiano_Geraldo_1-1731673370277.png


Now your table, should look like this:

Bibiano_Geraldo_2-1731673402515.png

 

I hope this was heplful, if yes please accept as solution and give a kudo.

 

Thank you

View solution in original post

Yes you can use any colour you like...

RGB Color Codes Chart 🎨

 

Replace "Orange" with the hex colour code of your liking. e.g. "#FFFFFF"

View solution in original post

6 REPLIES 6
Bibiano_Geraldo
Super User
Super User

Hi @powerbiexpert22,

Add a measure using the following DAX 

Priority Color = BLANK()

 

Now drag and drop the color measure to your Matrix, and add a conditional format as shown bellow:

Bibiano_Geraldo_0-1731672991889.png


Now configure the prompt screen to something like this and hit ok:

Bibiano_Geraldo_1-1731673370277.png


Now your table, should look like this:

Bibiano_Geraldo_2-1731673402515.png

 

I hope this was heplful, if yes please accept as solution and give a kudo.

 

Thank you

Kedar_Pande
Super User
Super User

@powerbiexpert22 

Create a new calculated column to hold blank values (it will serve as the placeholder for formatting):

BlankColumn = BLANK()

Create a measure to define the color logic for each priority:

PriorityColor = 
SWITCH(
TRUE(),
'YourTable'[Priority] = 0, "#00FF00", 
'YourTable'[Priority] = 1, "#FFA500", 
'YourTable'[Priority] = 2, "#FF0000", 
"#FFFFFF" -- Default to white
)

In the Conditional Formatting settings for BlankColumn, select the PriorityColor measure as the field for background color.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

ajohnso2
Super User
Super User

Hey,

You can create a measure to control the different colours and use that measure for conditional formatting.

 

Priority Colour =
VAR _Priority = MAX('Priority'[priority])
RETURN
SWITCH(
    TRUE(),
    _Priority = 0, "Green",
    _Priority = 1, "Orange",
    _Priority = 2, "Red"
)
 
ajohnso2_0-1731670348241.png

 

Hi @ajohnso2 , @Angith_Nair 

 

thanks, is there a way to show custom color like below in column

 

powerbiexpert22_1-1731674144416.png

 

Yes you can use any colour you like...

RGB Color Codes Chart 🎨

 

Replace "Orange" with the hex colour code of your liking. e.g. "#FFFFFF"

Angith_Nair
Continued Contributor
Continued Contributor

Hi @powerbiexpert22 

Create a measure that will display the priority. Apply background conditional formatting for this measure something like the below dax:

PriorityColor = 
SWITCH(
    TRUE(),
    TableName[Priority] = 0, "Green",
    TableName[Priority] = 1, "Orange",
    TableName[Priority] = 2, "Red",
    BLANK()
)

To ensure the column does not display any values make sure to format the text color to match the background color (via Conditional Formatting for text). Alternatively, make the font color transparent or very light so it blends with the table.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors