List.LastN

Syntax

List.LastN(list as list, optional countOrCondition as any) as any

Description

Returns the last item of the list list. If the list is empty, an exception is thrown. This function takes an optional parameter, countOrCondition, to support gathering multiple items or filtering items. countOrCondition can be specified in three ways:

Reference Data

https://docs.microsoft.com/en-us/powerquery-m/power-query-m-function-reference

Power Query M Functions / List Functions / List.LastN