OpenBI Docs Buy

Table.Last

The last 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.Last(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 last row as a record; the default when the table is empty.

Examples

The latest order

let
    Orders = #table({"Order", "Date"}, {{1, #date(2026, 1, 15)}, {2, #date(2026, 2, 2)}, {3, #date(2026, 3, 4)}})
in
    Table.Last(Orders)
[Order = 3, Date = #date(2026, 3, 4)]

No rows, no default

Table.Last(#table({"Order", "Date"}, {}))
null

Table.First, Table.LastN, List.Last.

Last updated · OpenBI Studio 0.3.79