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
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
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 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 54 | |
| 42 | |
| 30 | |
| 24 |