OpenBI Docs Buy

List.First

The first 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.First(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 first item, or the default.

Examples

The first product

List.First({"Coffee", "Tea", "Milk"})
"Coffee"

An empty list with a default

List.First({}, "none")
"none"

List.Last, List.FirstN, List.Single.

Last updated · OpenBI Studio 0.3.79