Forum Discussion

PBIraja's avatar
PBIraja
Frequent Visitor
4 years ago
Solved

conditional formatting

Hi,

how to apply the  background color based on below conditions.

 

  1. +-5% format the the cell background to YELLOW 
  2. greater than 5% format the cell background to GREEN 
  3. less than -5% format the cell background to RED 

 

thanks,

raja.

  • Hi, PBIraja 

     

    You can try the following methods.

    Measure:

    Measure =
    IF (
        SELECTEDVALUE ( 'Table'[Change] ) <= -0.05,
        "Red",
        IF ( SELECTEDVALUE ( 'Table'[Change] ) >= 0.05, "Green", "Yellow" )
    )
    

    Apply Measure to the background color of the percentage as shown in the figure.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

4 Replies

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, PBIraja 

     

    You can try the following methods.

    Measure:

    Measure =
    IF (
        SELECTEDVALUE ( 'Table'[Change] ) <= -0.05,
        "Red",
        IF ( SELECTEDVALUE ( 'Table'[Change] ) >= 0.05, "Green", "Yellow" )
    )
    

    Apply Measure to the background color of the percentage as shown in the figure.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

  • PBIraja , Assume you measure based on that you need that +/-

     

    a new measure =

    Switch(True() ,

    [Measure] *.95 , "Red",

    [Measure] * 1.05 , "Green",

    "Yellow"

    )

     

    use this conditional formatting using the field value option

    How to do conditional formatting by measure and apply it on pie? : https://youtu.be/RqBb5eBf_I4