OpenBI Docs Buy

Table.FromColumns

Makes a table from lists, each list a column.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.FromColumns(lists as list, optional columns as any) as table
ParameterTypeDescription
listslistThe columns' values, one list per column.
columnsany
optional
The column names as a list, a number of columns, or a table type; Column1, Column2 and so on when left out.

Returns

table. A table with as many rows as the longest list; a shorter list gives null in the rows it lacks.

Examples

Products and prices

Table.FromColumns({{"Chair", "Desk", "Lamp"}, {50, 120, 30}}, {"Product", "Price"})
ProductPrice
Chair50
Desk120
Lamp30

Lists of different lengths

Table.FromColumns({{"Chair", "Desk", "Lamp"}, {50, 120}})
Column1Column2
Chair50
Desk120
Lampnull

Table.FromRows, Table.FromRecords, Table.ToColumns, #table.

Last updated · OpenBI Studio 0.3.79