Table.FromRows
TableConstructs a table from a list of row lists, with optional column names or types.
Syntax
Table.FromRows(rows as list, optional columns as any) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
rows | list | Yes | A list of lists, where each inner list represents a row of values. |
columns | any | No | Optional. A list of column names, a table type, or a list of {name, type} pairs defining column names and types. |
Return Value
table — A table built from the provided list of row value lists.
Remarks
Table.FromRows constructs a table from a list of lists, where each inner list represents one row of values positionally mapped to columns. It is one of the most common ways to create small inline tables in Power Query — for lookup tables, test data, parameter sets, or reference values embedded directly in a query.
The columns parameter controls column naming and typing and accepts three forms:
- Omitted: columns are named Column1, Column2, etc., typed as any.
- List of strings: {"Name", "Score"} — sets column names, types remain any.
- Table type: type table [Name = text, Score = number] — sets both names and types. This is the recommended form for production queries because it ensures downstream type safety and enables accurate schema documentation.
Prefer #table(type table [...], {...}) shorthand for brevity in expressions where the table type is known at authoring time — it is equivalent to Table.FromRows with a type argument but more concise.
Examples
Example 1: Create an inline lookup table with named columns
Table.FromRows(
{
{1, "Alice", "New York", "NY"},
{2, "Bob", "Chicago", "IL"},
{3, "Charlie","Houston", "TX"},
{4, "Diana", "Seattle", "WA"}
},
{"CustomerID", "Name", "City", "State"}
)CustomerID | Name | City | State | |
|---|---|---|---|---|
| 1 | 1 | Alice | New York | NY |
| 2 | 2 | Bob | Chicago | IL |
| 3 | 3 | Charlie | Houston | TX |
| 4 | 4 | Diana | Seattle | WA |
Example 2: Create a typed table for schema-safe downstream use
Table.FromRows(
{{1,"Widget A","Widgets",25.00,true},{2,"Gadget B","Gadgets",50.00,true},{3,"Widget C","Widgets",15.00,false}},
type table [ProductID = number, ProductName = text, Category = text, Price = number, InStock = logical]
)ProductID | ProductName | Category | Price | InStock | |
|---|---|---|---|---|---|
| 1 | 1 | Widget A | Widgets | 25 | TRUE |
| 2 | 2 | Gadget B | Gadgets | 50 | TRUE |
| 3 | 3 | Widget C | Widgets | 15 | FALSE |
Example 3: Build a table from a dynamically generated list of rows
let
Products = #table({"ProductName","Price"},{{"Widget A",25.00},{"Gadget B",50.00},{"Widget C",15.00}}),
Rows = List.Transform(
Table.ToRows(Products),
each {_{0}, _{1}, _{1} * 1.1}
)
in
Table.FromRows(Rows, {"ProductName", "Price", "PriceWithTax"})ProductName | Price | PriceWithTax | |
|---|---|---|---|
| 1 | Widget A | 25 | 27.5 |
| 2 | Gadget B | 50 | 55 |
| 3 | Widget C | 15 | 16.5 |