Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Impactful Individual
1 year ago
Solved

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 s...
  • Angith_Nair's avatar
    1 year ago

    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.

  • Bibiano_Geraldo's avatar
    1 year ago

    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:


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


    Now your table, should look like this:

     

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

     

    Thank you

  • ajohnso2's avatar
    ajohnso2
    1 year ago

    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"