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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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!

1 ACCEPTED SOLUTION
dethompson97
Resolver III
Resolver III

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

 

FormatBackground.jpg

 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.

View solution in original post

1 REPLY 1
dethompson97
Resolver III
Resolver III

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

 

FormatBackground.jpg

 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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.