Forum Discussion

New_worker's avatar
New_worker
Helper II
1 year ago
Solved

Conditional formatting based on rules

Hi - Here is a confusion on below question. The West is marked in blue when the conditional formatting rules set as below. Why does it not match with the third conditional rule (orange)? But it fall...
  • danextian's avatar
    danextian
    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