web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Incompatibility Sort/S...
Power Apps
Unanswered

Incompatibility Sort/SortbyColumns with Last/LastN?

(0) ShareShare
ReportReport
Posted on by 126

Hi, everyone,

 

I hope you can help me with this problem. Apparently the "Sort" and/or "SortbyColumns" functions are incompatible with the "Last", or "LastN" function. Can this be? Funny thing is I haven't had any problems with it until yesterday. As of today, the latest data from SharePoint is no longer displayed in combination with "Sort and LastN". I can then search and edit them, but I can no longer see the elements directly in the APP.

 

Is this problem known to anyone?

 

SortByColumns(Schichtberichte_1;"Modified";Descending)
SortByColumns(LastN(Schichtberichte_1;5);"Modified";Descending)
LastN(SortByColumns(Schichtberichte_1;"Modified";Descending);5)

 

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Livearus 

    What if you were to call LastN on the return value of SortByColumns?

    Would that be logically be the same as the result that you want?

    LastN(
     SortByColumns(Schichtberichte_1;"Modified";Descending);
     5
    )
  • Livearus Profile Picture
    126 on at

    @timl 

    Unfortunately that doesn't help either. Above I gave some examples of the tried spelling. Including your suggestion. It doesn't seem to matter whether I use "LastN" within the "Sort" or "SortbyColumns" function or around it. 😞

  • WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    Hi @Livearus ,

    I think you are yet another victim of this bug, but you could try this workaround

    With(
     {
     wList:
     SortByColumns(
     Schichtberichte_1;
     "Modified";
     Descending
     )
     };
     LastN(wList;5)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    Hi @Livearus ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Livearus Profile Picture
    126 on at

    Hello, please excuse the late reply. I wasn't at work.

     

    Unfortunately your solution doesn't work either. In another APP which I have newly created, it works again. Very strange.

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard