Expression.Error: We cannot apply field access to the type
By Tahir Nas · Examples run in our simulator · Updated
Expression.Error: We cannot apply field access to the type Number.
[Name] syntax only works on a record (such as a table row). This error means the value in front of it is a number, text or list, typically inside List.Transform where _ is the list item, not a row.
Common causes
- Using [Column] inside List.Transform or List.Select, where each item is a plain value.
- Applying [Field] to a whole column list instead of a row.
- A record column that sometimes holds text or null instead of a record.
How to fix it
- Inside list functions, use _ for the item itself: List.Transform(list, each _ * 2).
- Work on the table with Table.AddColumn or Table.TransformColumns, where each receives a row or a cell.
- Check the value's type first: if _ is record then _[Field] else null.
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:
List.Transform({1, 2, 3}, each [Qty] * 2)Fixed:
List.Transform({1, 2, 3}, each _ * 2)Both snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.Error, the second must run.
Related lessons
- Lists in depth: build, transform, select and access
- Row context: whole-table values and the previous row
- Records in depth: fields, defaults and combining