Forum Discussion
Expression.SyntaxError: Token ',' expected.
- 3 months ago
Hi,
in der Regel wird der Fehler auch markiert. Beispiel:
Im Erweiterten Editor auf Fehler anzeigen klicken und es wird die Fehlerstelle vor dem Fehler so markiert (wie im schwarzen Rechteck gezeigt, also grau hinterlegt):
oder in der Einzelschrittanzeige so:
...mit Wellenlinie unterstrichen.
In beiden Fällen fehlt das Komma vor dem Schlüsselwort each.
Manchmal ist die Anzeige etwas verwirrend, besonders dann, wenn das abschließende Komma im vorhergehenden Schritt fehlt und der Fehler deshalb erst in der Folgezeile angezeigt wird (weil der Fehler davor moniert wird). Das solltest Du auch mal checken.
- 3 months ago
mig66
Expression.SyntaxError: Token ',' expected...This is a common syntax error in Power Query (M language). It means Power Query was expecting a comma (,) at a certain point in your code but didn't find one.
Most Common Causes
- Missing comma between items in a list {1, 2 3} or function arguments.
- Missing comma between fields in a record [A=1 B=2].
- Missing comma between steps in a let ... in expression (each step except the last before in needs a comma).
- Trailing comma at the end of a list/record/steps (e.g. {1, 2,}).
- Mismatched parentheses () or brackets.
- Issues when editing custom columns vs. Advanced Editor (case sensitivity, quotes, etc.).
How to Fix It Quickly
- Open Advanced Editor (right-click the query → Advanced Editor).
- Look for the red underline or the line Power Query highlights.
- Check every list, record, and step separation.
- Ensure the last item/step before in does not have a trailing comma.
powerquery does not have an undo option, but you can go back and forward using the applied steps list.
If you need more info about the applied steps list: Please go to https://learn.microsoft.com/en-us/power-query/applied-steps
Hello mig66,
We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
Thank you.