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

How to use both SortByColumn and CountRows

Hi,

 

Since CountRows is a non-delegable function on SharePoint, I want to sort by ID in descending which will get me the latest rows and then use the CountRows function on them. Any idea on how to do it, I have tried using the following but it is giving an error. What is the correct syntax? 

 

"Pending Approval (" & SortByColumns(Filter(WiFiAccess,CountRows(Filter(WiFiAccess,ApprovalStatus= "Pending"))),"ID", Descending) & ")"

 

"Pending Approval (" & SortByColumns(CountRows(Filter(WiFiAccess,ApprovalStatus= "Pending")),"ID", Descending) & ")"

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

Then don’t worry about it. The delegation warning isn’t an error it’s just a warning that if your filtered list is more than 2000 that not every item will be counted. You can safely ignore it.

View solution in original post

5 REPLIES 5
Super User III
Super User III

Consider this:

"Pending Approval (" & First(Sort(WiFiAccess,ID,Descending)).ApprovalStatus& ")"

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi,

 

I want to know the count as below which will display the pending number.

"Pending Approval (" & CountRows(Filter(WiFiAccess,ApprovalStatus= "Pending")) & ")"

 

Since CountRows is not a delegable function on SharePoint I want help in putting the Sort function so that it will count only the latest rows.

 

Regards

 

 

 

 

Super User II
Super User II

If the number of pending items is less than 2000, your formula above will work just fine. There is no need to sort them.

Hi @Drrickryp ,

 

So it will include the latest rows when doing the count?

I have included the sort by ID for the search box too because I have to include "in" and someone replied to use the sort by ID descending so that the search wont miss the latest entries. So I want to be sure if it will count the latest rows and yes the number will be less than 500. 

 

Super User II
Super User II

Then don’t worry about it. The delegation warning isn’t an error it’s just a warning that if your filtered list is more than 2000 that not every item will be counted. You can safely ignore it.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (105,921)