List.RemoveLastN

Syntax

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

Description

Returns a list that removes the last countOrCondition elements from the end of list list. If list has less than countOrCondition elements, an empty list is returned.

Reference Data

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

Power Query M Functions / List Functions / List.RemoveLastN