Forum Discussion

Sean-OReilly's avatar
Sean-OReilly
Helper IV
4 years ago

Issue with IF Statement when trying to add Custom Column

Hi

 

I am having an issue with IF Statement when trying to add Custom Column

Can you please let me know what is wrong with the below?

Thanks for your help in advance

 

3 Replies

  • Sean-OReilly . This is power query syntax is wrong

     

    if then else

     

    example

     

    if [Value.1] = "Ok" then "A"
    else if [Value.1] = "Procesing" then "Ok"
    else "Error"

  • Barthel's avatar
    Barthel
    Solution Sage

    Hey, 

     

    Try this:

    if [Division] = "McKeon Group" then "Group" else if [Division] = "Group" then "Group" else if [Division] = "Major Works" then "Major" else "0"
  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Sean-OReilly 

    I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

    If you need more help, please let me know.

     

    Best Regards,

    Community Support Team _Tang

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