Forum Discussion
Conditional formatting based on rules
- 1 year ago
The option switching to percent is bug but it uses the option selected when applied. Alternatively, you can write a measure that returns a color based on certain conditions and use it in conditional formatting as field value (select field value instead of rules).
SWITCH ( TRUE (), [my measure] < 0, "color/hex/rgb/rgba", [my measure] > 0, "color/hex/rgb/rgba", "black" ) --use certain colors like red, blue, green, gold, gray, etc which Power BI can interpret --use hex, RGB or RGBA colors
Hi danextian,
Thanks for your reply. I tried, but it will go back to 100% percent as the upper limit, and 0 percent for the lower limit when I re-open the conditional formatting (fx icon). I think, 100% percent and 0 percent are the same as what you mentitioned max (number) and min (number).
My question is that why West (-33K) cannot be matched with the orange condition when it is placed as the third condition but can be matched when it is placed as the last one.
The option switching to percent is bug but it uses the option selected when applied. Alternatively, you can write a measure that returns a color based on certain conditions and use it in conditional formatting as field value (select field value instead of rules).
SWITCH (
TRUE (),
[my measure] < 0, "color/hex/rgb/rgba",
[my measure] > 0, "color/hex/rgb/rgba",
"black"
)
--use certain colors like red, blue, green, gold, gray, etc which Power BI can interpret
--use hex, RGB or RGBA colors