Cheat Sheets/Power Apps/FirstN / LastN
Power Fx function

FirstN / LastNPower Fx function reference

Get the first or last N records.

Syntax

powerfx
FirstN( Table, Count ) / LastN( Table, Count )

Examples

powerfx
FirstN(Orders, 10)
Top 10
powerfx
FirstN(SortByColumns(Orders, "Created", SortOrder.Descending), 5)
powerfx
LastN(colActivityLog, 20)

Common mistakes & gotchas

Related Power Fx functions

From Filtering, search & sort

Used in these tutorials

← Back to the Power Apps (Power Fx) cheat sheet