Record.ToTable

Updated on

Record.ToTable is a Power Query M function that converts a record into a table with columns “Name” and “Value”. The function returns a table containing a row for each field in the input record with the field name and value

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Record.ToTable( record as record ) as table

Description

Record.ToTable converts a record into a table format, with each row representing a field and comprising two columns: Name for the field name and Value for the field’s content.

Examples

Return the table from the record.

Record.ToTable( [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0] )

 /* Output: 
Table.FromRecords( {
    [Name = "OrderID", Value = 1],
    [Name = "CustomerID", Value = 1],
    [Name = "Item", Value = "Fishing rod"],
    [Name = "Price", Value = 100]
} )
 */ 

Other functions related to Record.ToTable are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/record-totable