Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 121 | |
| 103 | |
| 46 | |
| 30 | |
| 24 |