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 ,
Could you share the Power Query M code from the Advanced Editor? That'll help us spot the syntax issue quickly.
In Power Query Editor → Home → Advanced Editor — paste the full code here and we can pinpoint exactly where the comma is missing.
Thanks!
Natarajan Manivasagan
If you found this helpful, please consider giving it a Kudos and marking it as the accepted solution — it goes a long way in helping others facing the same issue.
🏆 Best Solution for Enterprise BI — 2026 Microsoft Fabric Semantic Link Developer Experience Challenge
👉 Microsoft announcement · View the winning notebook
For more Power BI tips and discussions, let's connect on LinkedIn.
Cheers!