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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I need to change the card data value color dynamically by a measure that I can use in the fx of that card!
I have tried as below but it always shows green color; (colors need to be changed in range as below) GREEN-RED-BLACK
Also would like to add this if condition with above as well:
Solved! Go to Solution.
Hi @ngoswami ,
In your measure, Any value will satisfy the first two conditions, greater than 0 or less than 0.01, so it always returns green. If your desired result is :
0<Value<0.01 then green;
-0.01<Value<0 then red;
Value=0 then black.
Then here's my solution.
Measure =
IF (
'Variance Selection'[Lead Variance %] > 0
&& 'Variance Selection'[Lead Variance %] < 0.01,
"#2DD224",
IF (
'Variance Selection'[Lead Variance %] > -0.01
&& 'Variance Selection'[Lead Variance %] < 0,
"#D64550",
IF ( 'Variance Selection'[Lead Variance %] = 0, "#000000" )
)
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Hi @ngoswami ,
In your measure, Any value will satisfy the first two conditions, greater than 0 or less than 0.01, so it always returns green. If your desired result is :
0<Value<0.01 then green;
-0.01<Value<0 then red;
Value=0 then black.
Then here's my solution.
Measure =
IF (
'Variance Selection'[Lead Variance %] > 0
&& 'Variance Selection'[Lead Variance %] < 0.01,
"#2DD224",
IF (
'Variance Selection'[Lead Variance %] > -0.01
&& 'Variance Selection'[Lead Variance %] < 0,
"#D64550",
IF ( 'Variance Selection'[Lead Variance %] = 0, "#000000" )
)
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
The condition is wrong. Instead of IF, please use SWITCH (https://dax.guide/switch) and remember that the conditions are evaluated in the sequence you define.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
6 | |
4 | |
3 |