Record.Combine
RecordMerges a list of records into a single record.
Syntax
Record.Combine(records as list) as recordParameters
| Name | Type | Required | Description |
|---|---|---|---|
records | list | Yes | A list of records to merge into one. If multiple records share the same field name, the value from the last record in the list is used. |
Return Value
record — A single record containing all fields from the input records.
Remarks
Record.Combine merges a list of records into a single record containing all unique fields. When two or more records share the same field name, the value from the last record in the list takes precedence. This is useful for combining fields from different sources — for example, merging a Sales row with a Customers row to create a unified record. Be mindful of overlapping field names; rename or remove duplicates beforehand if you need to preserve both values.
Examples
Example 1: Combine fields from Sales and Customers rows
let
SalesRow = Record.SelectFields(Sales{0}, {"OrderID", "Product", "UnitPrice"}),
CustomerRow = Record.SelectFields(Customers{0}, {"CustomerID", "Name", "City"}),
Combined = Record.Combine({SalesRow, CustomerRow})
in
Record.ToTable(Combined)Result
Name | Value | |
|---|---|---|
| 1 | OrderID | 1 |
| 2 | Product | Widget A |
| 3 | UnitPrice | 25 |
| 4 | CustomerID | 1 |
| 5 | Name | Alice |
| 6 | City | New York |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks