Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

RightParen error in Custom Column

Can someone help with this formula. I'm getting a RightParen error

 

if( [#"Which Centre do you work in?"] = "Box Hill" then "Australia"

 

 

I need to do multiple if then else statements whereby it looks that the centre and determines a country. In this example if the centre is Box Hill I want the column to say Australia... I haven't done the else part of the formula cause it doesn't even like the text "Australia'. The red squiggle line is under "Aus so it does not like me typing "Australia" Why?

 

8 Replies

  • sturlaws's avatar
    sturlaws
    Resident Rockstar

    hi Anonymous,

     

    assuming your are trying to do this in Power Query, the syntax of the if-function is like this:

    if test then value_if_true else value_if_false

    without any paranthesis.

     

    Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

    • Anonymous's avatar
      Anonymous
      Not applicable

      No this does not work with or wthout parenthesis

       

      Reminder I'm after text not a value

      if test then text_if _true else text _if_false

      • sturlaws's avatar
        sturlaws
        Resident Rockstar

        I can't make out what your column name is, but if you add a custom column in power query this is the syntax

        if [column name] = "Box Hill" then "Australia" else "Other"

         

        Notice that the comparison is case sensitive

         

        Cheers,
        Sturla