Reply
New Member
Posts: 1
Registered: ‎03-27-2017

Lab 1, exercise 2, question 7 - error : 'Token rightparen expected'

Hi All,

 

I keep getting the error message 'Token rightparen expected'  which highlights a comma when I am trying to create the custom collumn in query editor mode. However if i use the same formula out of the query editor and just on data view, then the formula works. any ideas?

Member
Posts: 138
Registered: ‎03-10-2016

Re: Lab 1, exercise 2, question 7 - error : 'Token rightparen expected'

You can use formual to edit the query in Data view. You also refer the video named "Connecting to Files in a forder" from 5:20 in module1: Transforming Data using Power BI Desktop.

Regular Visitor
Posts: 17
Registered: ‎04-04-2017

Re: Lab 1, exercise 2, question 7 - error : 'Token rightparen expected'

Hello,

 

Can anyone please help me. I am getting stuck on so many  little things like this and getting so far behind in the process. I'm following the video "Connecting to files in a folder" to a T.  I add a Custom Column with this formula =If [Country]=null then "USA" else [Country], but I keep getting the error message "Token Eof Expected, and the error is on the word "then" in the formula., which causes the OK button to grey out so I can't proceed with adding the column. I can't move forward until I get this fixed.

 

Thanks,

Highlighted
Member
Posts: 138
Registered: ‎03-10-2016

Re: Lab 1, exercise 2, question 7 - error : 'Token rightparen expected'

Please change "If" to "if", the formula is very sensitive for case-sensitive.

Frequent Visitor
Posts: 2
Registered: ‎08-03-2017

Re: Lab 1, exercise 2, question 7 - error : 'Token rightparen expected'

You're using DAX syntax to write a function in M. The query editor uses a different language. It should be 

 

if [Country] = null then "USA" else [Country]

 

(Original solution here)