Downloads
Power Query MRecordIntermediate

Record.TransformFields

Returns a copy of a record in which chosen fields have been changed by a function.

Syntax
Record.TransformFields(record, transformOperations, optional missingField)

Returns: A new record with the transformed values.

What it does

Record.TransformFields applies a function to chosen fields of a record and leaves the rest alone. Use it to convert text amounts to numbers, trim spaces, or round a value, one field at a time. It is the record version of changing a few columns in a table.

Syntax and arguments

Example

A row from a text export has the amount and the date stored as text. The row needs proper types before it is totalled.

let
    RawRow = [Date = "2026-03-31", Amount = "1,250.00", Memo = "Rent"],
    Cleaned = Record.TransformFields(RawRow, {
        {"Amount", each Number.FromText(Text.Replace(_, ",", ""))},
        {"Date", each Date.FromText(_)}
    })
in
    Cleaned

Cleaned has the date as a date value and the amount as the number 1250. The memo is left as it was.

Example: a second, different use

Rounding one field to cents while leaving the others alone: {{"Rate", each Number.Round(_, 4)}} rounds only that field.

Things to watch

In business terms

Converting text exports to numbers and dates before they go into a model is a daily task in finance data work. Showing each conversion in the query makes the cleanup visible for review.

Related functions

All Power Query M functions · View as Markdown · M basics