Forum Discussion
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?
Hi Anonymous
You can add a conditional column, it is easier way to achieve your goal.
https://radacad.com/conditional-column-in-power-bi-using-power-query-you-can-do-anything
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
8 Replies
- sturlawsResident 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_falsewithout any paranthesis.
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.- AnonymousNot 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
- sturlawsResident 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
- v-juanli-msftCommunity Support
Hi Anonymous
You can add a conditional column, it is easier way to achieve your goal.
https://radacad.com/conditional-column-in-power-bi-using-power-query-you-can-do-anything
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.