cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Sorting issue

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanielaH
Level 8

Re: Sorting issue

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

 

View solution in original post

2 REPLIES 2
DanielaH
Level 8

Re: Sorting issue

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

 

View solution in original post

Anonymous
Not applicable

Re: Sorting issue

Perfect that worked. I just seem to get the comma and things in the wrong places. 

 

Thank you very much

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 287 members 3,507 guests
Please welcome our newest community members: