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
SaCvP125
Frequent Visitor

Enter a background colour based on another column value

Hi guys,

 

I've the following table:

SLA DescriptionTarget_ValueResultFlag
Time to Respond80%83%1
Time to Resolution95%79%0

 

What I'm trying to do is when my Result Value is higher than Target_Value then the Background of Result field should be green otherwise show red.  I read somewhere that this isn't possible and the only way is to create another column that compares the value and then use the conditional formatting to put the colours. That's what I'm doing with column Flag.

 

My question is If I can use the value from Column to format the background of my Result column. So simples as this: if the Flag = 1 then the background of Result should be Green ELSE Red.

 

This is possible?

 

Many thanks
The column Flag compare the values above and if the Result is higher than Target_Value then i

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @SaCvP125,

As what you said, I create calculated column using the formula.

Flag = IF(Table1[Result]>Table1[Target_Value],1,0)

1.PNG

Then you create a visual, select all the fields needed to show. Right click the Flag column->Conditional formatting->Front color scales. Then set the minimum as 0, the maximum as 1. 

conditional formatting for Flag columnconditional formatting for Flag columnSet the color of font in FlagSet the color of font in Flag
You will get expected result as follows.

4.PNG

Best Regards,
Angelia

 

View solution in original post

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @SaCvP125,

As what you said, I create calculated column using the formula.

Flag = IF(Table1[Result]>Table1[Target_Value],1,0)

1.PNG

Then you create a visual, select all the fields needed to show. Right click the Flag column->Conditional formatting->Front color scales. Then set the minimum as 0, the maximum as 1. 

conditional formatting for Flag columnconditional formatting for Flag columnSet the color of font in FlagSet the color of font in Flag
You will get expected result as follows.

4.PNG

Best Regards,
Angelia

 

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.