Table.ToRecords

Table.ToRecords is a Power Query M function that converts a table to a list of records. The function returns a list of records representing the rows of the table.

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

Syntax

Table.ToRecords( table as table ) as list

Description

Converts a table, table, to a list of records.

Examples

Convert the table to a list of records.

Table.ToRecords( 
    Table.FromRows( 
        {
            {1, "Bob", "123-4567"},
            {2, "Jim", "987-6543"},
            {3, "Paul", "543-7890"}
        },
        {"CustomerID", "Name", "Phone"}
     )
 )

 /* Output: 
{
    [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
    [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
    [CustomerID = 3, Name = "Paul", Phone = "543-7890"]
}
 */ 

Learn more about Table.ToRecords in the following articles:

Other functions related to Table.ToRecords are:

BI Gorilla Blog

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