cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Cannot enter let expression in advanced editor

I get a Token Eof expected error whenever I try to enter a let expression in the advanced editor. 

I have also tried pasting in the Hello World example expression, which also gives the same error.

I have uninstalled and reinstalled the desktop app and tested with a new blank PBIX file - same problem.

 

CJDK_0-1601040884026.png

Any suggestions to what the problem might be?

10 REPLIES 10
Highlighted
Super User IV
Super User IV

@ImkeF  , can you help with this.

 

@CJDK , I am hoping you are on latest power bi version



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted

Yes, I have downloaded and reinstalled today!

BTW tested also on another PC and same result.

Highlighted
Community Support
Community Support

Hi @CJDK ,

Token EoF expected error usually occurs when an invalid function name is used, or it uses the wrong case. You can refer the following documentations to create M query.

Power Query M formula language

Basics of M: Power Query Formula Language

Best Regards

Rena

Highlighted

Thanks @yingyinr  - the expression being entered is "let" - 100% correct - please note screenshot.

Highlighted
Community Support
Community Support

Hi @CJDK ,

Could you please try to paste the following codes in Advanced Editor and check if there is any syntax error in your side?

let
    Source = ""
in
    Source

Best Regards

Rena

Highlighted

Thanks @yingyinr 

Yes, I still get the error:

CJDK_0-1601368077058.png

 

Highlighted
Community Support
Community Support

Hi @CJDK ,

It is strange... Besides the codes which I shared with you, is there any other codes in your Advanced Editor? As checked your screenshot, the code start from line 11... By the way, what's the version of your Power BI Desktop? It is an app from Microsoft store or installation package version?

version.JPG

Best Regards

Rena

Highlighted

Hi @yingyinr 

Version: 2.85.681.0 64-bit (September 2020) - it is a downloaded version

Your code example works fine if I delete the preceding code. But the preceding code seems to be OK:

Editor1.png

 

Highlighted
Community Support
Community Support

Hi @CJDK ,

Whether you put the preceding code and my codes in Advance Editor at the same time(just like below screenshot)? If yes, then it will get syntax error...

Cannot enter let expression in advanced editor.JPG

Each query is composed of variables, expressions, and values encapsulated by a let expression. A let expression is made up of a let statement and an in statement, as shown in the following syntax:

let  
   Variablename = expression,  
   #"Variable name" = expression2  
in   
   Variablename​

If you just want to add new steps in advanced editor, first use commas to separate them and apply the variable from the previous step to define the logic in the new step.You can refer the following documentation for more details:

Power Query M Formula Language in Power BI Desktop

Power Query M Primer

Power Query M formula language

Best Regards

Rena

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors