Record.ToTable

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

Returns a table containing the columns Name and Value with a row for each field in record.

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:

BI Gorilla Blog

Last update: August 28, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/record-totable
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.