Forum Discussion

PBE's avatar
PBE
Icon for Helper II rankHelper II
4 years ago
Solved

Table column background based on number in another column

Hi

Help much appreciated.

I have a table where I want the 'Department' column background to change depending on value in 'Background No.' column.

I want this:-

to show as below based on the value in the Background No. column.

 

I can't get conditional formatting for the 'Department' column to do this.

Thank you

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  PBE ,

    You can create measures to customize colors based on color coding, and set the background color of fields through Conditional formatting.

    It is also possible to customize the colors by creating rules directly in Conditional formatting.

    Here are the steps you can follow:

    1. Select [Department] - Conditional formatting - Background color.

    2. Enter the Background color interface.

    Format style – Rules

    What field should we base this on -- Sum of [Background NO.]

    Click +New rule to add information, how many conditions to add how many rules

    If value = 1 Number

    Then you can customize the color

    3. Result:

    If you need pbix, please click here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • PBE's avatar
    PBE
    4 years ago

    Thank you Liu

     

    That worked well

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  PBE ,

    You can create measures to customize colors based on color coding, and set the background color of fields through Conditional formatting.

    It is also possible to customize the colors by creating rules directly in Conditional formatting.

    Here are the steps you can follow:

    1. Select [Department] - Conditional formatting - Background color.

    2. Enter the Background color interface.

    Format style – Rules

    What field should we base this on -- Sum of [Background NO.]

    Click +New rule to add information, how many conditions to add how many rules

    If value = 1 Number

    Then you can customize the color

    3. Result:

    If you need pbix, please click here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

    • PBE's avatar
      PBE
      Icon for Helper II rankHelper II

      Thanks Liu

       

      I will give it a try.

    • PBE's avatar
      PBE
      Icon for Helper II rankHelper II

      Thank you Liu

       

      That worked well

  • PBE , if this is Matrix, you can not. In the case of table visual, you can create a color measure and use that in conditional formatting using the field value option

     

    example

    Measure =
    Switch(true(),
    max(Table[Column]) = "R1" , "Red" ,
    max(Table[Column]) = "R2" , "Green" ,
    max(Table[Column]) = "R3" , "Pink "
    )

     

    color Measure =
    Switch(True() ,
    max(Table[ID]) in {10,20,30} ,"Red",
    max(Table[ID]) in {5,15,25} ,"Blue",
    "White"
    )

     

     

    How to do conditional formatting by measure and apply it on pie?
    https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
    https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539

    • PBE's avatar
      PBE
      Icon for Helper II rankHelper II

      Thank you Amitchandak.

      I don't understand the measure but will have a go at understanding it.