Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CJDK
Helper II
Helper II

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
v-yiruan-msft
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.
amitchandak
Super User
Super User

@ImkeF  , can you help with this.

 

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

Yes, I have downloaded and reinstalled today!

BTW tested also on another PC and same result.

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 @v-yiruan-msft  - the expression being entered is "let" - 100% correct - please note screenshot.

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 @v-yiruan-msft 

Yes, I still get the error:

CJDK_0-1601368077058.png

 

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 @v-yiruan-msft 

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

 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.