web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SUM Delegation SharePo...
Power Apps
Unanswered

SUM Delegation SharePoint List

(0) ShareShare
ReportReport
Posted on by 4
Hi

I have 3 SharePoint lists:
‘Products’
‘Orders’
‘Deliveries’

I want to display the ‘Products’ table in a vertical gallery and display the stock level for each product.

I am using the following formula:

Label_StockLevel.Text =
Sum( Filter( Orders, ProductID= ThisItem.ID), Quantity Ordered) - Sum( Filter( Deliveries, ProductID= ThisItem.ID), Quantity Delivered)

I can see why there is a delegation problem- for each item in the product table, every row of the Orders and Deliveries table needs to be checked to see if the ProductID matches.

Is there a way around this? Perhaps aggregating each table using GroupBy?

The workaround for bringing more than 2000 rows into the app using collections is not a viable option due to the performance issues that it would cause.

Thanks and please let me know if you require more information from me.
Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Borme 

    There is a sample database that can be downloaded that looks to me to be exactly on point to your question.  Please check https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/northwind-orders-canvas-overview .  I learned ALOT by going through the exercise of downloading it and building the app. 

  • Borme Profile Picture
    4 on at
    Thanks for the reply

    This is exactly what I am looking for however this example uses Common Data Service whereas I am using SharePoint lists.
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Borme 

    Unfortunately, Sum() is not delegatable with the SharePoint connector.  The only workaround that I am familiar with is a sequential collection as suggested here.  https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-Overcome-Delegation-with-SUM-function/m-p/365272 .  As far as I know Sql is the only connector that delegates aggregate functions to the server.  https://powerapps.microsoft.com/en-us/blog/latest-powerapps-update-adds-delegation-for-sum-average-min-and-max-functions-on-sql-server/ .  The entities in Common Data Service also allow for "roll-up" columns.  https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/define-rollup-fields .  You can vote for it in the Ideas part of the forum but this was requested by @Meneghino in 2017 and it is still listed as planned.  https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Extend-delegation-to-Sum-and-CountRows/idi-p/23193 

  • RezaDorrani Profile Picture
    12,143 on at

    Hi @Borme,

     

    I came across a useful API in SharePoint to get aggregate function values like Sum.

    Check it out:

    https://youtu.be/qsIn0mytC_8

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

    Thanks,
    Reza Dorrani, MVP
    YouTube
    Twitter

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard