Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Changing the background in a table based on two visualization columns?

Hi everyone, I'm pretty new to PowerBI and I'm having trouble changing the background of a visualization I've created. I have 2 columns in this visualization and I would like the background to be highlighted if Column A - Column B is < 0.

 

I tried creating a calculated column that subtracts these two but I don't think there's a relationship between them that allows it. I also looked in the Conditional Format tab but it looks like the conditions can only be based on one column.

 

I have a programming background so is there anyway to access the visualization object and manipulate it that way?

 

Any help would be greatly appreciated!

  • I believe you can do this by creating a measure that returns a value for color based on your condition (see below graphic)

     

     In this example, if the SUM of Column A was greater than the SUM of Column B, I returned "red" which in turn changed the background to that hideous red color LOL.  

     

    Hope this helps!

    Dawn Thompson

     

    PS:  If this solution works, please mark it as a solution to help others. Kudos are nice too.

1 Reply

  • I believe you can do this by creating a measure that returns a value for color based on your condition (see below graphic)

     

     In this example, if the SUM of Column A was greater than the SUM of Column B, I returned "red" which in turn changed the background to that hideous red color LOL.  

     

    Hope this helps!

    Dawn Thompson

     

    PS:  If this solution works, please mark it as a solution to help others. Kudos are nice too.