Table.First
The first row of a table, as a record.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.First(table as table, optional default as any) as any
| Parameter | Type | Description |
|---|---|---|
table | table | The table to read. |
default | any optional | What comes back when the table has no rows; null when left out. |
Returns
any. The first row as a record; the default when the table is empty.
Examples
The first line
Table.First(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}))
[Product = "Chair", Price = 50, Units = 4]
An empty table with a default
Table.First(#table({"Product", "Price"}, {}), [Product = "none", Price = 0])
[Product = "none", Price = 0]