This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have 3 fields ie., Columns
1)Goal
2)Actual
3)Better value
If the Actual is greater than the Goal and Better Value is High then the condition is True and 4th COlumn Status should be Green if condition fails then Status should be Red.
If the Actual is Less then the Goal and Better values is Low then the condition is True and 4th COlumn Status should be Green if condition fails then Status should be Red.
If the Actual is greater than the Goal and Better Value is Low then the condition is False and 4th COlumn Status should be Red.
If the Actual is Less than the Goal and Better value is high then the condition is False and 4th COlumn Status should be Red.
Goal Actuals Bettervalues Status
12.00 231.00 High G
13.00 321.00 Low R
231.00 123.00 Low G
321.00 421.00 High G
123.00 34.00 High R
321.00 34.00 Low G
34.00 153.86 Low R
34.00 157.80 High G
The code is somthing like this
if((Months_Actuals>Goal)and([Metric - better values]='Low'),red(),
if((Months_Actuals<Goal)and([Metric - better values]='High'),red(),green()))
how to do it in Powerbi DAX
I need to derive a Status Column newly and need to color the cell with Red and Green based on the condition
There is no Colour function in DAX, you have to use conditional formatting for a measure created with below formula
Status Color = IF(AND(SELECTEDVALUE('Test conditional Formating'[Actuals])>SELECTEDVALUE('Test conditional Formating'[Goal]),SELECTEDVALUE('Test conditional Formating'[Bettervalues])="Low"),1,IF(AND(SELECTEDVALUE('Test conditional Formating'[Actuals])<SELECTEDVALUE('Test conditional Formating'[Goal]),SELECTEDVALUE('Test conditional Formating'[Bettervalues])="High"),1,0))
Now you can go to formatting pane and there conditional format for 1 background and font color both as red and same green for 0.
I have uploaded sample file for you reference https://github.com/sourabhkant/PowerBI
HI @SaiKumar123,
Dax not contain any color coding functions, I'd like to suggest you use conditional formatting to instead.
Conditional formatting in tables
Regards,
Xiaoxin Sheng
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 42 | |
| 41 | |
| 21 | |
| 20 |