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
webportal
Impactful Individual
Impactful Individual

Conditional formatting of table rows

Ok, I promise I'll never understand conditional formatting in Power BI...

 

I want to format the rows of a table if column "Churn" is equal to "Label" like:

 

If it is: green

If it is not: red.

 

I tried all possible combinations with calculated measures, columns, etc, etc, etc, but nothing works.

 

Is it possible at all to do this?

 

Thank you!

webportal_0-1622568884926.png

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Try to do the following, create a measure

"Color" = 

VAR S_Value = SELECTEDVALUE(Table[Column])

RETURN IF(S_Value = "Label", "#00FF00", "#FF0000")

 

Then, select the column, go to Conditional Formatting > Background color > Field Value >Based on field: Select the measure "Color". That should do it.

Note: #00FF00 is HEX code for green, #FF0000 for red. You can customize this by opening a color palette and retrieving the HEX code.

View solution in original post

webportal
Impactful Individual
Impactful Individual

@Anonymous 

Thanks for your help!

View solution in original post

2 REPLIES 2
webportal
Impactful Individual
Impactful Individual

@Anonymous 

Thanks for your help!

Anonymous
Not applicable

Try to do the following, create a measure

"Color" = 

VAR S_Value = SELECTEDVALUE(Table[Column])

RETURN IF(S_Value = "Label", "#00FF00", "#FF0000")

 

Then, select the column, go to Conditional Formatting > Background color > Field Value >Based on field: Select the measure "Color". That should do it.

Note: #00FF00 is HEX code for green, #FF0000 for red. You can customize this by opening a color palette and retrieving the HEX code.

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.