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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Conditional formatting on Strings @ table cells

Hello,

i need to create Conditional formatting on cells of a table, and i would like to create something like

if CellValue is OK then show in green, else if cellvalue is KO show in red

 

I may be wrong, but PBI doesn't seem to accept strings to test/compare, only values and intervals.

 

Can you help me out?

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Let me know whether you'd like to get this:

003.PNG

You can add a measure: 

Measure 2 = IF(MAX('Table'[Column1])="KO","#FF0A18",IF(MAX('Table'[Column1])="OK","#15FF00"))

Then set the coditional formatting:

004.PNG005.PNG

Here's another post could be your reference: https://community.powerbi.com/t5/Desktop/Conditional-Formatting-based-on-percentage-of-multiple-values/m-p/720970#M347921

 

 

 

Community Support Team _ Dina Ye
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

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Let me know whether you'd like to get this:

003.PNG

You can add a measure: 

Measure 2 = IF(MAX('Table'[Column1])="KO","#FF0A18",IF(MAX('Table'[Column1])="OK","#15FF00"))

Then set the coditional formatting:

004.PNG005.PNG

Here's another post could be your reference: https://community.powerbi.com/t5/Desktop/Conditional-Formatting-based-on-percentage-of-multiple-values/m-p/720970#M347921

 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hello @v-diye-msft ,

 

from my understanding, this measureColorForX works for an existing calculated column, but if you try to create this measure for an existing measureX that is there shown on the column, it doesn't work. Basically if you go to the conditional formatting right clicking measureX that returns OK or KO, select format based on field value and try to select measureColorForX, you can't give an OK and move on.

 

Maybe i'm missing something, but i simply can't understand why i can't select a background color based on it's content...

 

Can you help me out?

JosefPrakljacic
Solution Sage
Solution Sage

Hello Ricardo,

 

I would add an conditional column either with a number (1=OK, 0=NOK) or a color code and based on that hidden column I would colorize your values.

 

Here a usefull link regarding the colorizing with hex codes

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-formatting-by-f...

 

@Anonymous I hope my answer was helpful and may I ask you to mark it as solution/kudo it if that was the case.

 

I wish you a nice and successful day

 

BR,

Josef

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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