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?
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...
Each query is composed of variables, expressions, and values encapsulated by alet expression. Aletexpression is made up of aletstatement and aninstatement, as shown in the following syntax:
Variablename = expression,
#"Variable name" = expression2
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: