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() Collection withi...
Power Apps
Answered

Sum() Collection within Gallery

(0) ShareShare
ReportReport
Posted on by 77

Hi all, can someone please point me to the right direction. I have a txtLabel outside of the gallery where I use it to sum the total number input within the gallery.

nicklimcs_3-1713337569660.png

 

Below is the txtLabel Text property. The output I am expecting is 9 instead of 10. 

 

Sum(galTasks.AllItems, numInputPartner.Value)

 

 

Another example, the output should be 1 instead of 2

nicklimcs_5-1713338013293.png

 

 

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @nicklimcs ,

     

    Do you want to sum all items with "Meeting with clients" + "Draft"?

    Please try this.

     

    Sum(AddColumns(Gallery.AllItems,"sum",Value(TextInput1.Text)+Value(TextInput2.Text)),sum)

     

    vmengmlimsft_0-1713338994016.png

     

     

    Best reards,

    Rimmon

  • WarrenBelz Profile Picture
    155,399 Most Valuable Professional on at

    Hi @nicklimcs ,

    Firstly try

    Sum(
     galTasks.AllItems, 
     Value(numInputPartner.Value)
    )

    If that does not work, but in a Classic Text Input and use

    Sum(
     galTasks.AllItems, 
     Value(TextInputName.Text)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • nicklimcs Profile Picture
    77 on at

    Hi @v-mengmli-msft 

     

    In my case, there's only ONE txtInput within the gallery. The reason you're seeing two is because the Collection has two rows of record. 

    nicklimcs_1-1713340519606.png

     

    nicklimcs_0-1713340426650.png

     

  • nicklimcs Profile Picture
    77 on at

    Hi @WarrenBelz 

     

    No luck with any of it, still having the same problem unfortunately.

  • JamesYumnam Profile Picture
    on at

    Hi @nicklimcs , as previously suggested by @WarrenBelz, the below Sum() works in my case.

    JamesYumnam_0-1713341695299.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Explore my blog James Yumnam

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @nicklimcs ,

     

    It's wired, your original formula should be work. Are there other formulas on the TextInput?

    Maybe you can try this first.

    Sum(AddColumns(galTasks.AllItems,"Input",numInputPartner.Value),Input)

     

    Best regards,

    Rimmon

  • WarrenBelz Profile Picture
    155,399 Most Valuable Professional on at

    @JamesYumnam ,

    Please tag me if you want further assistance - the Classic Text Input certainly should work.

  • Verified answer
    nicklimcs Profile Picture
    77 on at

    @WarrenBelz @v-mengmli-msft 

     

    So it turns out that it won't sum properly if the text input control is within a Container sitting in a Gallery.

    nicklimcs_0-1713393323239.png

     

    In another post, they suggested to create a txt label directly in the Gallery and reference to the txt input within the Container. Then sum the txt label to get the result which is working for me. 

    nicklimcs_1-1713393410663.png

     

    Is this a bug or is there another way to change the formula for it to work?

  • Verified answer
    WarrenBelz Profile Picture
    155,399 Most Valuable Professional on at

    @nicklimcs ,
    As long as both the gallery and your sum label are in the same container, it should work.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard