cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Livearus
Helper III
Helper III

Incompatibility Sort/SortbyColumns with Last/LastN?

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)

 

5 REPLIES 5
timl
Super User
Super User

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
Helper III
Helper III

@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. 😞

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
Super User
Super User

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

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,902)