Power Fx function
First / Last — Power 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
- Both return a single record (or blank on an empty table), not a one-row table — chain a field directly, e.g. First(Table).Column.
- Last() typically is not delegable on tabular connectors, since determining "last" requires knowing the full row order — watch for the delegation warning on large tables.
Related Power Fx functions
From Filtering, search & sort