Table.ToColumns
A table's columns as a list of lists: one list of values per column.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.ToColumns(table as table) as list
| Parameter | Type | Description |
|---|---|---|
table | table | The table to take apart. |
Returns
list. A list per column, in column order, each with the column's values from top to bottom.
Remarks
- The column names are not part of it;
Table.FromColumnsbuilds a table from such a list again.
Examples
Two columns
Table.ToColumns(#table({"Product", "Price"}, {{"Chair", 50}, {"Desk", 120}}))
{{"Chair", "Desk"}, {50, 120}}
Related functions
Table.FromColumns, Table.ToRows, Table.Column, Table.ToRecords.