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 / Power Apps Dataverse S...
Power Apps
Answered

Power Apps Dataverse Sum Delegation

(0) ShareShare
ReportReport
Posted on by

With my Power App\ Dataverse solution, I am observing a Delegation Warning on the following expression;

<Sum(Filter(Table,Column1=A, Column2=B, Column3=C),Column4)>

 

It was my understanding that Sum\Filter was supported as delegable. Am I wrong?

Is it possible it still indicates a Warning-- even though it is still supported?

 

Also, I came across a suggestion to add the ForAll, like so;

<Sum(ForAll(Filter(Table,Column1=A, Column2=B, Column3=C),Column4),Value)>

This does remove the Delegation Warning-- but have concerns with performance with this solve...?

 

Appreciate any insights.

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @kent-culpepper - SUM is delegable in Dataverse for Number columns.

     

    Could you please confirm what the data types are for the columns you're filtering on? (Column 1, 2 & 3)

  • kent-culpepper Profile Picture
    on at

    All 3 are text.

  • kent-culpepper Profile Picture
    on at

    And the sum column is currency, if that's any consequence..

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @kent-culpepper - Currency columns, although are displayed as a Number type in Power Apps, are not delegable and this is stated in the Power Apps documentation for Dataverse.

     

    Amik_0-1705273584401.png

     

    Image ref: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/connections/connection-common-data-service#power-apps-delegable-functions-and-operations-for-dataverse 

     

    Suggested Options:

    Option 1: If you are not leveraging the currency feature in Dataverse, use a Number data type instead.

     

    Option 2: There are no workarounds for functions which are not delegable. You can hide the message with workarounds, but the delegation will persist. However, you rightly point out that the Filter function is delegable.

     

    If you can pre-filter your data with the With function based on a specific criteria that you are confident will return less than 2,000 rows, you can then perform the SUM function on a Currency data type on that smaller subset of data. For example we could have population data that has 50,000 rows of people per district, but if we know that each neighbourhood within those districts will return less than 2,000 rows, it is ok to use a non-delegable function within that smaller subset using delegable Filters.

     

    With this understanding in mind, consider revising your formula to:

     

     

     

    With(
     {
     _pre_filtered_data: Filter(
     Table,
     Column1 = "A",
     Column2 = "B",
     Column3 = "C"
     )
     },
     Sum(
     _pre_filtered_data,
     Column4
     )
    )

     

     

  • kent-culpepper Profile Picture
    on at

    Ah, didnt know there was a "With" function, ala SQL\CTE.

     

    I have 70+ columns across a few tables that are currency-- to change to number, which is not a problem functionally-- would be a huge pain.

     

    What would you suggest in terms of performance...?

     

    1- change to number

    2- use with

    3- any validity to the "forall" solution?

    4- also seen solutions loading multiple collections and combining...?

     

    of course, looking to optimize performance and scale.

     

    thanks for your help.

     

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @kent-culpepper - 

     

    1. change to number: painful yes, but the best option you have because you will have eliminated all delegation concerns.

    2. use with: as mentioned, so long as you can be certain your Filterparameters will return less than 2000 rows, the formula will work. However, given you have a far superior option above, you run the risk of overengineering your app without any need to.

    3. any validity to the "forall" solution? - ForAll is not delegable, and it's purpose has no relevance to what you're trying to do.

    4. also seen solutions loading multiple collections and combining...? - As above, there is no need to use Collections for this scenario and it is good practice to avoid using them unless you have a good reason.

  • kent-culpepper Profile Picture
    on at

    haha, afraid you were going to say... thanks again.

  • kent-culpepper Profile Picture
    on at

    Did some testing.. I am observing something strange..

     

    Following are a couple expressions in my editable gallery\grid. In both instances, the Column\Measure being summed is a Currency type.

     

    This one displays a Delegable Warning;

    Sum(
    Filter(
    Entries_Months,
    Calendar_Month.Quarter_Id = txtQuarter.Text,
    Partner_Name = ddPartner_Entries.Selected.Value,
    Entity_Name = ddEntity_Entries.Selected.Value,
    Investment_Name = ddInvestment_Quarter.Selected.Value
    ),
    Contribution
    )

     

    This one does not return a Delegable Warning;

    Text(
    Sum(
    If(
    //Quarter or Year-to-Date Entry Mode
    selQuarterEntry,
    //Quarter entry mode
    //Sum of "Current" Bank Transaction Entry Measure = Selected Quarter
    Filter(
    Entries_Months,
    Calendar_Month.Quarter_Id = txtQuarter.Text,
    Partner_Name = ddPartner_Entries.Selected.Value,
    Entity_Name = ddEntity_Entries.Selected.Value,
    Investment_Name = ddInvestment_Quarter.Selected.Value
    ),
    //Ytd entry mode
    //Sum of "Current" Bank Transaction Entry Measure = Year-to-Date
    Filter(
    Entries_Months,
    Calendar_Month.Year_Id = Year(ThisItem.Calendar_Quarter.Quarter_Date),
    Calendar_Month.Quarter_Date <= ThisItem.Calendar_Quarter.Quarter_Date,
    Partner_Name = ddPartner_Entries.Selected.Value,
    Entity_Name = ddEntity_Entries.Selected.Value,
    Investment_Name = ddInvestment_Quarter.Selected.Value
    )
    ),
    Contribution
    ),
    "$#,##0.00"
    )

     

    Warning Bug?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard