Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi experts,
On this table, i want to add background color
For each values. If the value greater than 90
the color is grean ,and if the value between 90 and 60
The color is yellow, and if the value less than 60 the color is red .
Can anyone please help me with this?
Solved! Go to Solution.
Measure =
if(SELECTEDVALUE('Table'[Test])="Test1",
var _value = MAX('Table'[Values])
RETURN SWITCH(TRUE(),_value>90,"green",_value>60&&_value<=90,"yellow",_value<60,"red")
)
Hi @Lolo_2023 ,
If you are presenting the same "Value" value, you can refer to the following expression:
Measure = var _value = MAX('Table'[Values])
RETURN SWITCH(TRUE(),_value>90,"green",_value>60&&_value<=90,"yellow",_value<60,"red")
Please feel free to correct me and provide more information if I have misunderstood you!
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Actually i want these conditions to be performed on just “Type1”
then add that condition to your measure. Only return something if the SELECTEDVALUE of Type is "Type1".
Could you please provide more explanation?
Measure =
if(SELECTEDVALUE('Table'[Test])="Test1",
var _value = MAX('Table'[Values])
RETURN SWITCH(TRUE(),_value>90,"green",_value>60&&_value<=90,"yellow",_value<60,"red")
)
it is works perfectly, but when I am trying to change the numbers, it didn't work
Measure =
if(SELECTEDVALUE('Test'[Type])="Type1",
var _value = MAX('Test'[Values])
RETURNSWITCH(TRUE(),_value>=800&&_value<2000,"#5CB989",_value>=400&&_value<799,"#F9BA66",_value>=0&&_value<399,"#E87B72")
)
can you please check this for me
MEASURE =
IF (
SELECTEDVALUE ( 'Test'[Type] ) = "Type1",
VAR _value =
MAX ( 'Test'[Values] )
RETURN
SWITCH (
TRUE (),
_value < 400, "#E87B72",
_value < 800, "#F9BA66",
_value < 2000, "#5CB989"
)
)
Unfortunately, it didn't work
It works!
THANK YOU.
Are these independent measures or do you have a field in the column area?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |