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 / Sum of DataField in Br...
Power Apps
Answered

Sum of DataField in BrowseGallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How to calculate Sum of all DataField from browsegallary. I have tried using formula

Sum(TextBox3)

but it is fetching only first card value . It is not taking values for all card. Suggest some help

Categories:
I have the same question (0)
  • Steelman70 Profile Picture
    873 on at

    Hi, if I understood you question correctly, you should insert a text box outside the data gallery and set its text property to Sum(Source, DataField).  Please see this example:

     

     Capture2.PNG

     

    PS The Text( ... , "#,###.00") around the sum is just for formatting

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have filterd the datasource on BrowseScreen. Now I want calculate the result based on filtered data that currently showing on BrowseScreen

  • Verified answer
    Steelman70 Profile Picture
    873 on at

    How about Sum(Filter(Source, XXX  > YYY), DataField) where XXX > YYY is the same filter condition as the gallery?

     

    Alternatively you can:

    1. Put your filtered records in a collection with ClearCollect
    2. Set the Items of your gallery to this collection
    3. Set the sum text box to show the sum of the collection's data field

    What is the event/trigger for the filtering of the data source?

     

    If you post some screenshots or formulas it may be easier to help you.

  • audrieFCT Profile Picture
    987 on at

    I was trying to do this too. Did you get an answer outside of the forum on how to perform a SUM based on a filter? (I don't have a gallery in my case, I'm just summing data from a data source.)

  • rgruian Profile Picture
    Microsoft Employee on at

    Hi Audrie,

     

    Assuming for example you have a data source "ShoppingCart" with at least one numeric column e.g. "Price", and you want to sum over a filtered view of the the data source, e.g. if Price < 1000:

     

        = Sum(Filter(ShoppingCart, Price < 1000), Price)

     

    Alternatively you can also fold the filtering logic into the aggregator itself:

     

        = Sum(ShoppingCart, If(Price < 1000, Price, 0))

     

    Please do keep in mind however that aggregators such as Sum, Average, etc -- are not yet delegated to the data service back-end. This means they can only operate on up to 500 rows of data at the moment, until PowerApps gets aggregate query delegation support.

     

  • audrieFCT Profile Picture
    987 on at

    Thank you.

     

    Do you know if  "aggregate query delegation support" is planned this fiscal year or not?

  • rgruian Profile Picture
    Microsoft Employee on at

    We are actively working on this feature. We will ship it as soon as it's finalized and deemed rock-solid.

     

    Thanks for your patience.

  • audrieFCT Profile Picture
    987 on at

    MVP it man! (Perfection is over-rated) Smiles

     

    Thanks for all of your help!

  • Phyre Profile Picture
    2 on at

    You need to be specific about the column name.

     

    This works as follows:

     

        Sum(Collection; [@ColumnName])    - Comma separators don't work for me (en-ZA)

        ~ or ~

        Sum(Collection, [@ColumnName])   - Comma separator seems commonplace for all other users Smiley Happy

     

  • mkujalowicz Profile Picture
    on at

    Hello,

    Im not sure if there was an update for this topic, but none of the above solutions worked for me as I imagine that I delegate the 'Sum' opertation to the data source with the filters applied in the gallery. The error message I get is the following:

    Part of this formula cannot be evaluated remotely.'Sum' operation is not supported by this connector/service.

     

    What I try to achieve is to sum gallery items based on the filters set in two dropdowns, something similar to SUBTOTAL in Excel.

    Please help.

    Thanks!

    Magda

    powerapps.png

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 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard