Expression.SyntaxError: Token Literal expected
By Tahir Nas · Examples run in our simulator · Updated
Expression.SyntaxError: Token Literal expected.
The parser reached a place where a value should be, such as after an operator or before a closing bracket, and found nothing. Typically an expression was cut off while editing.
Common causes
- An operator with nothing after it: [Qty] * .
- A trailing comma inside a list: {1, 2, }.
- A step deleted in the Advanced Editor that left its reference behind.
How to fix it
- Complete or remove the dangling operator.
- Remove trailing commas inside lists and records.
- Undo the last edit, then make the change in smaller pieces.
Find the step that fails
- Open the query in the Power Query editor (Excel: Data → Queries & Connections → Edit; Power BI Desktop: Transform data).
- Click the steps in Applied Steps from the top. The first step that shows the error is where it starts; later steps only repeat it.
- Read that step's formula in the formula bar (View → Formula Bar if it's hidden) and compare it with the columns and values the previous step produced.
Minimal example
Raises the error:
1 + Fixed:
1 + 2Both snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.SyntaxError, the second must run.