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

The Record.ToTable function in Power Query converts a record into a table format. In the resulting table, each row represents a field from the original record. The table has two columns: Name, which contains the field name, and Value, which contains the field’s content.

Examples

To illustrate how to use the Record.ToTable function, let’s consider the following record:

[Citrus = "Orange", Berry = "Strawberry", StoneFruit = "Peach"]

You can convert this record into a table by using the Record.ToTable function as follows:

Record.ToTable([Citrus = "Orange", Berry = "Strawberry", StoneFruit = "Peach"] )

The output of this operation is a table with two columns: Name and Value.

Record.ToTable creates a table from a record in Power Query

In the resulting table:

  • The first column, Name, contains the field names: Citrus, Berry, and StoneFruit.
  • The second column, Value, contains the corresponding field values: Orange, Strawberry, and Peach.

Other functions related to Record.ToTable are:

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

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy