Table.FromRows

Table

Constructs a table from a list of row lists, with optional column names or types.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.FromRows(rows as list, optional columns as any) as table

Parameters

NameTypeRequiredDescription
rowslistYesA list of lists, where each inner list represents a row of values.
columnsanyNoOptional. A list of column names, a table type, or a list of {name, type} pairs defining column names and types.

Return Value

tableA 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"}
)
Result
CustomerID
Name
City
State
11AliceNew YorkNY
22BobChicagoIL
33CharlieHoustonTX
44DianaSeattleWA

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]
)
Result
ProductID
ProductName
Category
Price
InStock
11Widget AWidgets25TRUE
22Gadget BGadgets50TRUE
33Widget CWidgets15FALSE

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"})
Result
ProductName
Price
PriceWithTax
1Widget A2527.5
2Gadget B5055
3Widget C1516.5

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks