If you want to drop a few fields from a record, and keep everything else, the Record.RemoveFields function is what you reach for. It returns a new record with the fields you name taken out, leaving the rest in their original order. Available in Excel (Power Query), Power BI Desktop, and Power BI Service.
Syntax of Record.RemoveFields Function
Record.RemoveFields(record as record, fields as any, optional missingField as nullable number) as record
where
record(required, record). The source record you want to drop fields from.fields(required, any). The field names to remove, given as a list like{"City","Phone"}. A single name as plain text also works. The fields you do not name stay in their original order.missingField(optional, nullable number). Controls what happens when you name a field that the record does not have. Leave it out and a missing name raises an error. PassMissingField.Ignoreto skip the absent name silently instead.
Returns: a new record containing every field except the ones you named, in their original order. The original record is left unchanged.
In plain terms, you hand it a record and a list of field names, and it gives you back the same record with those fields stripped out.
Example 1: Remove one field from a record
Say you have a person record with three fields and you want to drop the Age field.
let
Source = Record.RemoveFields([Name="Ava",City="Pune",Age=29],"Age")
in
Source
Result: [Name = "Ava", City = "Pune"]
The Age field is removed, and Name and City stay exactly where they were. For a single field you can pass the name as plain text, with no list needed.
Example 2: Remove multiple fields with a list
To drop more than one field, pass the names as a list instead of a single text value.
Here you have an employee record and want to strip out the City and Phone fields.
let
Source = Record.RemoveFields([Name="Liam",Dept="Sales",City="Austin",Phone="555-0140"],{"City","Phone"})
in
Source
Result: [Name = "Liam", Dept = "Sales"]
Both named fields are gone, and the survivors Name and Dept keep their original order.
Example 3: Handle a field that is not in the record
Naming a field the record does not have throws an error by default. Pass MissingField.Ignore to skip the absent name instead.
This record has Product, Price, and Stock, but you ask to remove Discount, which is not there.
let
Source = Record.RemoveFields([Product="Mug",Price=12,Stock=40],"Discount")
in
Source
Result: Expression.Error: The field 'Discount' of the record wasn't found.
Add MissingField.Ignore as a third argument and the call stops erroring. Here you ask to remove both Discount (missing) and Stock (present):
let
Source = Record.RemoveFields([Product="Mug",Price=12,Stock=40],{"Discount","Stock"},MissingField.Ignore)
in
Source
Result: [Product = "Mug", Price = 12]
The missing Discount is skipped quietly, Stock is removed, and you get back the two fields that are left.
Example 4: Drop a field from every row of a table
Record.RemoveFields works on a single record, so to use it across a table you run it per row with Table.TransformRows, then turn the records back into a table with Table.FromRecords.
Here is the starting data, with an Internal column you want gone:
| OrderID | Customer | Internal |
|---|---|---|
| 1001 | Ava | flag-a |
| 1002 | Liam | flag-b |
| 1003 | Noah | flag-c |
Remove the Internal field from each row:
let
Source = Excel.CurrentWorkbook(){[Name="Orders"]}[Content],
Typed = Table.TransformColumnTypes(Source,{{"OrderID",Int64.Type},{"Customer",type text},{"Internal",type text}}),
Cleaned = Table.FromRecords(Table.TransformRows(Typed,each Record.RemoveFields(_,"Internal")))
in
Cleaned
Each row is a record, so Record.RemoveFields drops the Internal field from every one.
The result keeps just the two columns:
| OrderID | Customer |
|---|---|
| 1001 | Ava |
| 1002 | Liam |
| 1003 | Noah |
Table.TransformRows runs your function once per row, much like List.Transform does for a list.
Example 5: For a whole table, use Table.RemoveColumns
If you are working on a full table rather than a single record, you do not need the per-row trick. Table.SelectColumns and its sibling Table.RemoveColumns are the table-level tools. Table.RemoveColumns drops the columns you name directly.
Here is the starting data:
| OrderID | Customer | Internal |
|---|---|---|
| 1001 | Ava | flag-a |
| 1002 | Liam | flag-b |
| 1003 | Noah | flag-c |
Drop the Internal column directly:
let
Source = Excel.CurrentWorkbook(){[Name="Orders"]}[Content],
Dropped = Table.RemoveColumns(Source,{"Internal"})
in
Dropped
The result has only the two remaining columns:
| OrderID | Customer |
|---|---|
| 1001 | Ava |
| 1002 | Liam |
| 1003 | Noah |
This is the cleaner choice when your data is already a table. Reach for Record.RemoveFields when you are inside a record, for example a single row pulled out with Table.TransformRows.
Things to keep in mind with Record.RemoveFields
fieldstakes a single name or a list. A lone field is fine as plain text ("Age"), and{"Age"}does the same thing. Use the list form when you have more than one.- Field names are case-sensitive.
"age"will not match a field calledAge, so it counts as a missing name and triggers the error below. - A missing field throws by default. Naming a field the record does not have raises
Expression.Error: The field 'X' of the record wasn't found.PassMissingField.Ignoreas the third argument to skip absent names silently. - Surviving fields keep their original order. Unlike
Record.SelectFields, which reorders to match your list,Record.RemoveFieldsleaves the remaining fields exactly where they were. - It is the inverse of
Record.SelectFields. This names what to drop, whileRecord.SelectFieldsnames what to keep. Pick whichever needs the shorter list. - To read a single value, use
Record.Fieldinstead.Record.RemoveFieldsalways returns a record, so useRecord.Fieldwhen you want the bare value of one field rather than a trimmed-down record. - For a whole table, use
Table.RemoveColumns. It drops columns directly, no per-row record handling needed.
Common questions about Record.RemoveFields
How is Record.RemoveFields different from Record.SelectFields?
They are opposites. Record.RemoveFields keeps everything except the fields you name, while Record.SelectFields keeps only the fields you name. Use whichever leaves you with the shorter list to write.
What is the difference between Record.RemoveFields and Table.RemoveColumns?
Record.RemoveFields works on one record at a time, while Table.RemoveColumns drops columns from an entire table at once. Use the record version when you are inside a single row, and the table version for the whole dataset.
List of All Power Query Functions
Related Power Query Functions / Articles: