Announcements
HI
I have this query
LastN(Filter('Incident Log',spgCaseID = displayItem.ID),5)
that pulls 5 last records of a SP list. I need to just add sorting to it so that it sorts it decending order. Where do i add that in the query please?
Thank you
Hi JoelHj
Try this:
SortByColumns(LastN(Filter('Incident Log',spgCaseID = displayItem.ID),5),"spgCaseID", // Use name of column you want to sort by //Descending)
Sorting documentation: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort
Perfect that worked. I just seem to get the comma and things in the wrong places.
Thank you very much
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 396 Super User 2026 Season 2
Mohsin Ali 323
WarrenBelz 193 Most Valuable Professional