OpenBI Docs Buy

#table

Builds a table in M from its column names (or a table type) and its rows, each a list of values.

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

Syntax

#table(columns as any, rows as any) as table
ParameterTypeDescription
columnsanyA list of column names; a table type, which gives the columns' types too; or a number of columns, named Column1, Column2 ...
rowsanyA list of rows, each a list of values in column order.

Returns

table. The table, its columns typed when a table type was given.

Remarks

  • Each row needs as many values as there are columns.
  • A small table typed by hand is the quickest way to try a step: every example on these pages starts from one.

Examples

Names and rows

#table({"Product", "Price"}, {{"Chair", 50}, {"Desk", 120}})
ProductPrice
Chair50
Desk120

With a table type

The type gives each column its type, as Table.Schema shows.

Table.Schema(#table(type table [Product = text, Price = number], {{"Chair", 50}}))[[Name], [Kind]]
NameKind
Producttext
Pricenumber

A number of columns

#table(2, {{"Chair", 50}})
Column1Column2
Chair50

Table.FromRecords, Table.FromRows, Table.Schema, Table.ColumnNames.

Last updated · OpenBI Studio 0.3.79