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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
stuross1129
Frequent Visitor

Conditional format color of background based on text value, across multiple columns

I am trying to shade the background color Red on any cells in a table that contain the text value = "No" and green for any values = "Yes".

 

Is there a simple way to do this with a single expression that will apply to all cell values?

 

 

colorcells.png

 

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @stuross1129,

 

If you use a Table visual to show data, you have to set conditional background colors for each column one by one. For example, to set conditional formatting for Step1, please create a measure first. If you have N columns, then, you need N mesaures.

Measure for step1 = IF(SELECTEDVALUE(Table2[Step1])="Yes",1,0)

4.PNG

 

As a workaround, you can unpivot table first in Query Editor mode, then, use a Matrix to analyse data.

1.PNG

 

2.PNG

 

Measure 2 = IF(SELECTEDVALUE('Table2 (2)'[Value])="Yes",1,0)

3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @stuross1129,

 

If you use a Table visual to show data, you have to set conditional background colors for each column one by one. For example, to set conditional formatting for Step1, please create a measure first. If you have N columns, then, you need N mesaures.

Measure for step1 = IF(SELECTEDVALUE(Table2[Step1])="Yes",1,0)

4.PNG

 

As a workaround, you can unpivot table first in Query Editor mode, then, use a Matrix to analyse data.

1.PNG

 

2.PNG

 

Measure 2 = IF(SELECTEDVALUE('Table2 (2)'[Value])="Yes",1,0)

3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.