Table.FromRows
Makes a table from lists, each list a row.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.FromRows(rows as list, optional columns as any) as table
| Parameter | Type | Description |
|---|---|---|
rows | list | The rows, each a list of values in column order. |
columns | any 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 one row per list.
Examples
With column names
Table.FromRows({{"Chair", 50}, {"Desk", 120}}, {"Product", "Price"})
| Product | Price |
|---|---|
| Chair | 50 |
| Desk | 120 |
With a table type
Table.Schema(Table.FromRows({{"Chair", 50}}, type table [Product = text, Price = number]))[[Name], [Kind]]
| Name | Kind |
|---|---|
| Product | text |
| Price | number |