Power QueryExercises

Expression.Error: The name '_' wasn't recognized (missing each)

By Tahir Nas · Examples run in our simulator · Updated

Expression.Error: The name '_' wasn't recognized. Make sure it's spelled correctly.

[Column] is shorthand for _[Column], and _ only exists inside each (or a function with a parameter called _). Writing a condition like [Qty] > 0 without each makes M look for _ and fail.

Common causes

How to fix it

  1. Add each: Table.SelectRows(Source, each [Qty] > 0).
  2. Or write the function in full: (row) => row[Qty] > 0.
  3. Remember that functions which take a row or a value always need each or => .

Find the step that fails

Minimal example

Raises the error:

Table.SelectRows(#table({"Qty"}, {{1}}), [Qty] > 0)

Fixed:

Table.SelectRows(#table({"Qty"}, {{1}}), each [Qty] > 0)

Both 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

Related lessons

Similar errors