Forum Discussion

Ptolemaida's avatar
Ptolemaida
Frequent Visitor
1 year ago
Solved

How to apply conditional formatting to negative values

I try to transform the negative %'s in RED, and the positive ones in GREEN for the field "AvsF YTD%"

Entering a large negative number in the first value field does not seem to work

Any tips?

  • Hello  
    You can use a conditional field measure for formatting as below;

    Measure 2 =
    VAR _vaL = [Measure]
    RETURN
    SWITCH(TRUE(),
    _vaL < 0 && _vaL > -0.3, "YELLOW",
    _vaL < -0.3 && _vaL > -0.55, "PINK",
    "")

    Ptolemaida

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from BIswajit_Das , please allow me to add some more information:
    Hi  Ptolemaida ,

     

    Here are the steps you can follow:

    1. Create measure.

    color measure =
    IF(
        [AvsF YTD%] >=0 ,"green","red")

    2. Select[AvsF YTD%] – Conditional formatting – Background color.

    3. Go to the Background color interface.

    Format style – Field value

    What field should we base this on – [color measure]

    4. Result:

     

     

    Best Regards,

    Liu Yang

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

2 Replies

  • BIswajit_Das's avatar
    BIswajit_Das
    Impactful Individual

    Hello  
    You can use a conditional field measure for formatting as below;

    Measure 2 =
    VAR _vaL = [Measure]
    RETURN
    SWITCH(TRUE(),
    _vaL < 0 && _vaL > -0.3, "YELLOW",
    _vaL < -0.3 && _vaL > -0.55, "PINK",
    "")

    Ptolemaida

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from BIswajit_Das , please allow me to add some more information:
    Hi  Ptolemaida ,

     

    Here are the steps you can follow:

    1. Create measure.

    color measure =
    IF(
        [AvsF YTD%] >=0 ,"green","red")

    2. Select[AvsF YTD%] – Conditional formatting – Background color.

    3. Go to the Background color interface.

    Format style – Field value

    What field should we base this on – [color measure]

    4. Result:

     

     

    Best Regards,

    Liu Yang

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