Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |