cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jblane
Helper I
Helper I

Return bottom results when Filtering SQL table?

I asked a similar question yesterday, but this has a slightly different nuance:

Say I want to Filter a SQL table, but I know that Filter will return > 2000 items. Is there a way to return the bottom 2000 items of that Filter result instead of the top 2000? Or delegate a SQL "order by" to the statement so that I can invert the order of the result?


Thank you.

3 REPLIES 3
mdevaney
Super User III
Super User III

@jblane 
You could  SORT the filter results in descending order by ID to get the last record like this.

First(Sort(Filter(your_datasource_name, ColumnName="Value"), Descending, ID))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

So I want the entire result of the Filter statement, not just the First row, which I should have been more clear on.

My concern about nesting a Filter within a Sort is that the Filter will return only the first 2000 records from the server's response and then sort those in descending order, correct? Or will that Sort method sort the entire 2000+ results from the Filter statement?

Thanks.

@jblane 

SORT + FILTER can both be delegated.  Yes, it can return more than 2,000 records.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (58,132)