Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register 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
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 30 | |
| 26 | |
| 25 |