Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

issue in IF statement | expression.error

Hi,   Please, I need help to solve the problem below     Thank you 🙂  
  • AlB's avatar
    5 years ago

    Hi Anonymous 

    Just drop the parentheses: "(" and ")" and don't capitalize the if

     

    = if [Exectuted percentage] = 100 then "Completed" else "Null"

     

    you can also use null instead of the text "Null"

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

  • PhilipTreacy's avatar
    5 years ago

    Hi Anonymous 

    Just a couple of notes, M is case sensitive and the if statement must be in lower case, so you must write if rather than IF

    You can set the result of the if to be the actual value null rather than the text string "Null" e.g.

     

    = if [Executed Percentage]=100 then "Completed" else null

     

    Phil


    If I answered your question please mark my post as the solution.
    If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.