Expression.Error: The name wasn't recognized
By Tahir Nas · Examples run in our simulator · Published · Updated
Expression.Error: The name 'Filtered Rows' wasn't recognized. Make sure it's spelled correctly.
M code refers to a step, query or function name that doesn't exist. Usually a step was renamed or deleted, or a function name is misspelled or wrongly capitalised.
Common causes
- A step referenced by a later step was renamed or removed.
- Function names are case-sensitive: Table.selectrows doesn't exist.
- A query referenced by name was renamed.
How to fix it
- Make each step refer to the actual previous step name.
- Check capitalisation of functions.
- Use the editor's IntelliSense to pick names.
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:
let Source = 1, Next = #"Filtered Rows" + 1 in NextFixed:
let Source = 1, Next = Source + 1 in NextBoth snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.Error, the second must run.
Practise avoiding it
- beginner~7 minFree
Fix a query whose steps point at the wrong step (kite shop)
A step was renamed and the next step still refers to the old name. Repair the chain so the query runs.
- beginner~6 minFree
Remove a leftover step that cuts the data short (kite shop)
A Kept First Rows step left over from testing silently drops orders. Find it and remove it.
- beginner~5 minFree
Return the last step, not an earlier one (kite shop)
The query builds a Line Total column, but the result doesn't show it: the `in` clause returns an earlier step.
- beginner~6 minFree
Fix a Changed Type step that breaks two columns (kite shop)
An automatic type step turned customer names into errors and stripped the zeros from order numbers.