cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support
Community Support

Hi @CJDK   ,

Whether the problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help other members in the community find the solution easily if they face the similar problem with you. Thank you.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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!

Yes, I have downloaded and reinstalled today!

BTW tested also on another PC and same result.

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @yingyinr 

Yes, I still get the error:

CJDK_0-1601368077058.png

 

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

 

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

 

 

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors