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
.
In the resulting table:
- The first column,
Name
, contains the field names:Citrus
,Berry
, andStoneFruit
. - The second column,
Value
, contains the corresponding field values:Orange
,Strawberry
, andPeach
.
Related functions
Other functions related to Record.ToTable are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy