OpenBI Docs Buy

List.Last

The last item of a list, or a default when the list is empty.

Group: List. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

List.Last(list as list, optional defaultValue as any) as any
ParameterTypeDescription
listlistThe list.
defaultValueany
optional
What to give for an empty list; null when left out.

Returns

any. The last item, or the default.

Examples

The latest reading

List.Last({412, 418, 431})
431

An empty list with a default

List.Last({}, 0)
0

List.First, List.LastN.

Last updated · OpenBI Studio 0.3.79