List.LastN Function in Power Query

The List.LastN function returns the last set of items in a list by specifying how many items to return or a qualifying condition.

Syntax

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

Example: Return the last two items of the list.

Power Query M

let
  Source = {"India", "America", "Canada", "Japan", "Australia", "England"}, 
  Return = List.LastN(Source, 2)
in
  Return  

The output of the above code is shown below:

List.LastN function in Power Query