Expression.Error: The field already exists in the record
By Tahir Nas · Examples run in our simulator · Updated
Expression.Error: The field 'Total' already exists in the record.
A step tried to create a column whose name is already taken: Add Column, Rename, Expand or Promote Headers produced a duplicate name.
Common causes
- Adding a custom column with an existing name.
- Renaming a column to a name another column already has.
- Expanding a merged table whose columns share names with the main table.
How to fix it
- Pick a new name, or remove the old column first.
- When expanding, use the new column names argument or keep the default prefix.
- Rename both columns in one Table.RenameColumns call when swapping 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:
Table.AddColumn(#table({"Qty", "Total"}, {{2, 10}}), "Total", each [Qty] * 5)Fixed:
Table.AddColumn(#table({"Qty", "Total"}, {{2, 10}}), "Total check", each [Qty] * 5)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
- beginner~6 minFree
Rename and reorder columns for a finance report (kite shop)
Give columns business-friendly names and put them in the order finance expects.
- intermediate~7 minFree
Move the key column first and keep the rest in order (it assets)
Put AssetID first. Every other column keeps its current order, including columns added in future exports.
- advanced~9 minFree
Rename columns from a mapping table (ledger)
Finance keeps a two-column table of old and new column names. Apply it, ignoring names the export doesn't have.