Forum Discussion

russellj's avatar
russellj
Frequent Visitor
2 years ago
Solved

Conditional formatting on a card visual

Hello,

 

Any idea why conditional formatting in PowerBI is so awkward? It doesn't seem possible to format a card value green if positive and red if negative. I simply can't select the right conditions in the 2 rules to cover > 0 for green and < 0 for red. It doesn't let you select the right operators. See the following screenshot, only greater than is allowed in the first column and only less than is allowed in the second column. The number/percentage is greyed out.

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi russellj 

     

    For your question, here is the method I provided:

     

    Create a measure.

     

    color setting = 
        IF(
            SELECTEDVALUE('Table'[Values]) > 0, 
            "Green", 
            IF(
                SELECTEDVALUE('Table'[Values]) < 0, 
                "Red" 
            )
        )

     

    Select the fields you want to add color to.

     

     

     

    Here is the result.

     

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi russellj 

     

    For your question, here is the method I provided:

     

    Create a measure.

     

    color setting = 
        IF(
            SELECTEDVALUE('Table'[Values]) > 0, 
            "Green", 
            IF(
                SELECTEDVALUE('Table'[Values]) < 0, 
                "Red" 
            )
        )

     

    Select the fields you want to add color to.

     

     

     

    Here is the result.

     

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.