Forum Discussion

Clint's avatar
Clint
Helper V
7 years ago
Solved

If Statement question

Hello,   I'm trying to write an If (or Switch - neither is working) statement that returns a string of "low" "moderate" or "high" based on a risk exposure value.  I've tried something like this: ...
  • alexvc's avatar
    7 years ago

    Hi there,

     

    The problem is the order of the conditions, for instance, if you evaluate a 5 in your formula the first condition is if > 1 then Low. This is the first condition that runs into and complies, so the result will be low instead of high. Also, there are more conditions that needed, I recommend you rewrite your formula starting from the lowest conditional value up to the highest, and only using one way condition (either < or >):

     

    C_Risk Severity =
    If('risks'[exposure]<=2, "Low",If('risks'[exposure]<=4, "Moderate","High"))
     
    Let me know if this helps