Record.FromTable

Record.FromTable is a Power Query M function that converts a table of records with field names and value names into a single record. The function returns a record created from the input table, or throws an exception if the field names are not unique.

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

Syntax

Record.FromTable( table as table ) as record

Description

Returns a record from a table of records table containing field names and value names {[Name = name, Value = value]}. An exception is thrown if the field names are not unique.

Examples

Create a record from the table of the form Table.FromRecords( {[Name = “CustomerID”, Value = 1], [Name = “Name”, Value = “Bob”], [Name = “Phone”, Value = “123-4567”]} ).

// Output: [CustomerID = 1, Name = "Bob", Phone = "123-4567"]
Record.FromTable( 
    Table.FromRecords( {
        [Name = "CustomerID", Value = 1],
        [Name = "Name", Value = "Bob"],
        [Name = "Phone", Value = "123-4567"]
    } )
 )

Other functions related to Record.FromTable are:

BI Gorilla Blog

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