Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a column of "Target" values with some blank rows and a measure calculation "Measure1" based off other columns. I want to create a new column "Value Color" that compares the Measure1 to the Target values and then gives a color based off comparison.
But the Target has blank rows, so if the Target is blank, then I don't want a color for "Value Color".
I want the dax calculation to be
ValueColor =
IF (
ISBLANK ( 'Table'[Target] ),
BLANK (),
IF (
[Measure1] > 'Table'[Target],
"#31991a",
IF ( [Measure1] <= 'Table'[Target], "#ff4a4a" )
)
)
Solved! Go to Solution.
better to do a switch statement ie.
ValueColor =
SWITCH (
TRUE (),
ISBLANK ( 'Table'[Target] ), BLANK (),
[Measure1] > SUM ( 'Table'[Target] ), "#31991a",
[Measure1] <= SUM ( 'Table'[Target] ), "#ff4a4a",
BLANK ()
)
Proud to be a Super User!
Hi @Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
better to do a switch statement ie.
ValueColor =
SWITCH (
TRUE (),
ISBLANK ( 'Table'[Target] ), BLANK (),
[Measure1] > SUM ( 'Table'[Target] ), "#31991a",
[Measure1] <= SUM ( 'Table'[Target] ), "#ff4a4a",
BLANK ()
)
Proud to be a Super User!
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 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |