Forum Discussion

Louis66's avatar
Louis66
Resolver I
3 years ago
Solved

Conditional formatting working partially !!!

Hello, I have a simple problem - I have positive and negative returns for an Index... using Conditional formatting (measure), all my bars are blue, even though I have negative returns (sould be in Re...
  • Pragati11's avatar
    Pragati11
    3 years ago

    HI Louis66 ,

     

    So in that case you need to modify your measure. Use SUM(Data[Returns]) in your condition in the measure.

    You won't need a SELECTEDVALUE there. You can write your measure something like following:

    Color =
    VAR returns_value = SUM ( Data[Returns] ) // total value of the value used
    RETURN
        SWITCH (
            TRUE (),
            returns_value < 0, "#FF0000", // hexcode for Red color
            "#0000FF" // hexcode for Blue color
        )

    I just wrote the DAX above on the fly, so check if there are any syntax errors.