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
Hi mig66,
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to Omid_Motamedise, pcoley & ralf_anton for sharing valuable insights.
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.