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 / Problem with sum and d...
Power Apps
Unanswered

Problem with sum and delegation

(0) ShareShare
ReportReport
Posted on by 65

Good morning friends,
I need help. Currently I created a button in my app that adds up the number of items in the column and appears as a notification, to find out how many items there are in that place. It is working but I am concerned with the delegation, because the powerapps already inform that this function is not delegable, so it may not have the correct result above 500 items. How can I fix this? I tried to create a formula with filter but I couldn't. Follow the print for better understanding. Thank you

Capturar.PNG
Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Increase the delegation limit to 2000 At File.. setting Advance Setting

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

    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.

     

  • straiderox2 Profile Picture
    65 on at

    Thanks @eka24 

    Thanks for the tip, I just changed :). But I'm still worried. This app I made has the insertion of about 50 items per day. When I reach the limit I will have this problem again. I can't make a formula that solves this?

     

  • eka24 Profile Picture
    20,925 on at

    If your Datasource is Sharepointlist, consider watching this tutorial;

    https://youtu.be/qsIn0mytC_8

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

    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.

  • straiderox2 Profile Picture
    65 on at

    I will watch my friend.
    I also found this link https://powerapps.microsoft.com/en-us/blog/latest-powerapps-update-adds-delegation-for-sum-average-min-and-max-functions-on-sql-server /, but I didn't understand the concept because it was made for SQL. I looked at the attached print and tried to adapt it to my case, but without success, I don't know what to put where there is Linetotal

    Capturar.PNG
  • eka24 Profile Picture
    20,925 on at
    What is your Datasource?
  • straiderox2 Profile Picture
    65 on at

    Sharepoint

  • eka24 Profile Picture
    20,925 on at

    If you are confirming ad SharePoint, then you didn't watch the tutorial because everything on the video is Sharepointlist

     

    Kindly watch it

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

    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.

  • roamer7485 Profile Picture
    112 on at

    This suggested solution works both on Sharepoint and SQL Server. Create an integer field or column in your source table, make 1 as a default for it. In all my tables, I call that extra field "ic" as integer count, or whatever you may call it. So every time a new record is added, 1 is automatically given to its "ic". You see a number is delegable to the backend in both Sharepoint and SQL Server. So if you make "ic" as a parameter in your Sum() function, you get the sum of all your records no matter if they exceed 2000 rows.

     

    Here's an example on how I'm using that extra field for counting the number of records. In all my apps, it's been my practice to give a user an info about how many records there are in the datasource when he filters the gallery by entering some characters in a textbox. It's an extract of a record counting block of code in my equipment maintenance app.

     

    Sum(
    Search(
    Filter( 'mySQLServerDatasource', (ic = 1) ),
    Trim(txtSearch.Text),
    "EQUIPID",
    "EQUIP_DESCR",
    "STAGE_ID",
    "FACILITY",
    "TYPENAME",
    "MAINT_TEMP",
    "PROVIDER",
    "SPECIALIZED",
    "BYPASS_REASON"
    ),
    ic
    )

     

    I put this block of code behind the text property of a label that shows the record count.

     

    1.) First, the Filter() function filters against the datasource with "ic=1".

    2.) Then Search() searches for records which fields that may contain the string of characters in the trimmed txtSearch.Text . The user types some characters into this textbox to search.

    3.) Finally, the Sum() function sums up the resultset's ic. This is now the count of records.

     

    Instead of using CountRows() to count the number of records, I use Sum() against the "ic" to give me the count of records. I watched someone's video that does similar way to count the records with more than 2000 records but he used Flow to do it. He passed some parameters for Flow to do his CountRows. My method doesn't need Flow to get the count; it's using Sum() with that extra integer field with 1 as the default.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard