Forum Discussion

Evanooruvan's avatar
Evanooruvan
Helper II
3 years ago
Solved

Apply conditional formatting for different section

I would like to give different conditional formatting for product bakery
while others should remain the same

 

PaulDBrown🙂

  • Hi Evanooruvan ,

     

    For this you need to create a metric that refers explicity to the bakery products something similar to:

     

    Formatting =
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 10, "green",
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 20, "red",
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 50, "blue"
    )

1 Reply

  • Hi Evanooruvan ,

     

    For this you need to create a metric that refers explicity to the bakery products something similar to:

     

    Formatting =
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 10, "green",
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 20, "red",
        SELECTEDVALUE ( Table[product_category] ) = "Bakery"
            && SUM ( Table[current_retail_price] ) < 50, "blue"
    )