Forum Discussion

lesg's avatar
lesg
Frequent Visitor
3 years ago

Conditional Formatting based on column value

Hi Guys,

 

I have a column showing current stock and a column showing required stock holding.

 

If the required stock holding is >= current stock, I want that to be coloured in Green

If the required stocking holding is < current stock, I want this to be red

 

When I try to do this in the conditional formatting by selecting 'Field value', whilst I can select the field (cover) it does not show and gives me no further options to complete this condition?

 

 

Is this a bug or is there a different way to set this value

 

 

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi lesg 

    Your measure may have some issues so that you cannot choose the measure, you can try the following measure:

    Measure = if(SUM('Table'[Required Cover])>=SUM('Table'[on Hand]),"Green","Red")

     

    Best Regards!

    Yolo Zhu

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

    • lesg's avatar
      lesg
      Frequent Visitor

      Hi,

      Thanks for that suggestion, however, when I try and add, I get an error:

       

       

      The cover is a measure created work out how much stock should be required and not an actual column in the table?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi lesg 

        You can try the following code :

        Measure = if([Cover]>=SUM('Table'[on Hand]),"Green","Red")

        and you need to put the measure to the conditional formatting:

         

        Best Regards!

        Yolo Zhu

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

         

  • Here you can see that the Sales column has been conditionally formatted based on the  values in the Profit Column. Hope this helps

    • lesg's avatar
      lesg
      Frequent Visitor

      Hi Thanks for that, but does not seem to help im my situation, any numbers I add I dont get any different results.

      I assume I use the maximum number? I tried 500 up to your example, 20000:

       

       

       

      • Padycosmos's avatar
        Padycosmos
        Solution Sage

        Yes, you can change Percentage to Number in the Rules dropdown. Also type >= Max in the second rule on the right hand side condition