Cheat Sheets/Power Apps/First / Last
Power Fx function

First / LastPower Fx function reference

Get the first or last record.

Syntax

powerfx
First( Table ) / Last( Table )

Examples

powerfx
First(Sort(Orders, Created, SortOrder.Descending))
Newest order
powerfx
First(SortByColumns(Tasks, "DueDate", SortOrder.Ascending)).Title
powerfx
Last(Filter(Orders, CustomerID = ThisItem.ID))

Common mistakes & gotchas

Related Power Fx functions

From Filtering, search & sort

Used in these tutorials

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