Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
If target <=Actual then Actual value show show in Green font/ background color else Red
Thanks.
Solved! Go to Solution.
Hi @Anonymous,
Create a Measure that returns the Hex Code you want to apply to your Back/Font Color, then use the Field Value option when setting up conditional formatting
back color = if([target]<=[actual], "#008000", "#FF0000")Hope this helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Proud to be a Super User!
Hi @Anonymous,
Create a Measure that returns the Hex Code you want to apply to your Back/Font Color, then use the Field Value option when setting up conditional formatting
back color = if([target]<=[actual], "#008000", "#FF0000")Hope this helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Proud to be a Super User!
Thank you for your solution. Now I got one measure with color code. How can I use this with conditional formating so font or background of Target color should get.
Hi @Anonymous,
You would use the conditional value by value option
Proud to be a Super User!
Hi @sbhan4,
The Value needs to be a string that represents the color, like the back color measure created
Proud to be a Super User!
Thanks for your help!. It's not working. I have created a Black color measure. How to use that column for conditional formating.
Could you please try it in power bi workbook for me.
If Target is < Actual - red color font
if target >= Actual - Red color font
Hi @Anonymous,
Have a look at this .pbix, sample.pbix , it contains a conditional formatting measure.
Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Proud to be a Super User!
@richbenmintz Perfect!! It was helpful.
Hi @Anonymous,
Assuming [Target] and [Actual] are measures, you would likely use
if([target]<=[actual], "#FFFFFF", "#008000")The Coalesce in my example was a shortcut for an 'Or' condition, essentially checking to see if any of the cases evaluated to true().
Richard
Proud to be a Super User!
@Anonymous , create a measure that returns color based on this condition and use that in conditional formatting with "Field" Option
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
Color = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")
refer
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 37 | |
| 29 | |
| 24 |