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 / SortByColumns not show...
Power Apps
Answered

SortByColumns not showing all data

(0) ShareShare
ReportReport
Posted on by 67

Hi experts,

 

I am struggling with the following function;

 

Distinct(SortByColumns('SP list',"Id",SortOrder.Descending),'BatchNr')

This function is used for a Combobox. The function worked perfect until my SharePoint list became big = (over 1500 rows), then the function stoped show the rows which is added recenlty.

 

My understanding is; the function is limited by using the tirm "SortByColumns".

 

Then I would like "Combobox" show the last 30 rows only.  Or use a new extra date box and connect the existing Combobox??

 

Is anybody here can help me?

 

BR

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Appsforourlife,

     

    Your current function will list the Batch Number of the records with the most recently created IDs. Do note that a ComboBox can only show up to 2000 items - the exact amount is defined by your Data Row Limit in your app settings.

     

    If you only want to display the last 30 records, you can filter by ID descendingly as you do now and only take the first 30 records:

    Distinct(
     FirstN(
     SortByColumns(
     'SP list',
     "Id",
     SortOrder.Descending
     ),
     30
     ),
     'BatchNr'
    )

     

    You can also prefilter the data with only relevant records (e.g. add a DatePicker to your screen):

    Distinct(
     SortByColumns(
     //Filter by date first
     Filter(
     'SP list',
     Created >= DatePickerName.SelectedDate
     ),
     "Id",
     SortOrder.Descending
     ),
     'BatchNr'
    )

     

    Since you are filtering on ID descendingly (newly created records first) I wouldn't expect new records not to show up but rather older records disappearing.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Appsforourlife Profile Picture
    67 on at

    Hi @LaurensM ,

     

    Unfortunately, it gives the same results. "not the newst data included"

    I have stared to register data the in SH list since a year ago, the function worked perfectly until 28th of June. Drop list "Combobox" shoes all data before 28th but 29, 30/06 and up are not shown.

     

    If i use distinct('SP list', BatchNr) then i see all the data but the newst is in the end ... of course not sorted descendingly because BatchNr column is not sortable. for this reason i wanted to sort according ID.

     

    I really appreciete another suggestion.

    BR

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Do you have the same issue when sorting via creation date? Unfortunately I am unable to recreate the issue on my end, both ID and Creation date work.

     

    Distinct(
     Sort(
     'SP list',
     Created,
     SortOrder.Descending
     ),
     'BatchNr'
    )

     

    I hope this helps!

  • Appsforourlife Profile Picture
    67 on at

    Thank you so match, this works!!😍

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard