OpenBI Docs Buy

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
ParameterTypeDescription
tabletableThe table to read.
defaultany
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]

Table.Last, Table.FirstN, Table.FirstValue, List.First.

Last updated · OpenBI Studio 0.3.79