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 / Display sum of a colum...
Power Apps
Unanswered

Display sum of a column all the values in gallery

(0) ShareShare
ReportReport
Posted on by 95

I have a column A. I'm able to display the change in its value in gallery before saving it into the DB using the following code.

 

If(IsBlank(LookUp(MyCollection, ID = ThisItem.ID).A),
ThisItem.A,LookUp(MyCollection, ID = ThisItem.ID).A)

 

Just for reference,  MyCollection the collection where change in value is stored. A is the col where value is changed.
Now I have a col B in my gallery only where I want to display the sum of all the values of col A. I also want to capture the live value(like if value of col A is changed in a row then sum in should also be changed in gallery before saving anything in DB).

Categories:
I have the same question (0)
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @MAli_Ch ,

    In your gallery, create a label where you want to display the sum.
    Set the Text property of this label to the following formula:

    Sum(MyCollection, A)

    If you think my solution is helpful for you, then please accept it. 😊

  • MAli_Ch Profile Picture
    95 on at

    Hi @MudassarSZ365 

    The sum you mentioned will only show the collection values sum. I need sum of values which are in collection(changed values) + sum of value which are not in collection(unchanged values).

  • MudassarSZ365 Profile Picture
    591 on at

    @MAli_Ch ,

    First, create a new collection that combines the original data source with the changes from MyCollection. This collection will have the latest values for each item, whether changed or unchanged.

     

     

    ClearCollect(CombinedCollection,
     ForAll(YourOriginalDataSource,
     If(IsBlank(LookUp(MyCollection, ID = ID)),
     {ID: ID, A: A},
     {ID: ID, A: LookUp(MyCollection, ID = ID).A}
     )
     )
    )

     

     

    Now, use this CombinedCollection to calculate the sum. In the label where you want to display the sum, set the Text property to:

     

     

    Sum(CombinedCollection, A)

     

     

    If you think my solution is helpful for you, then please accept it. 😊

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard