Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Sum function in a collection

Like (0) ShareShare
ReportReport
Posted on 7 Jul 2021 04:00:35 by 66

Hi!

I have a Gallery which has a record of item prices. The records to the gallery are added from a form. I am trying to write a sum function that would display the total sum of item prices:

ekoz21_1-1625630293865.png

 

I used the following formula:

"Total Sum, Eur: "& Sum(ColStolenArticles, Value(Suma_lbl.Text))


However, I keep getting a blank outcome. Any help is much appreciated!

  • Verified answer
    Dipak_Shaw Profile Picture
    108 on 07 Jul 2021 at 04:20:41
    Re: Sum function in a collection

    Hi, 
    if you want to sum the items of a gallery outside the gallery.

    You should use 

    "Total Sum, Eur: "&Sum(Gallery1.AllItems,SumPrice)

    Where -

    Gallery1 = Your gallery name.

    SumPrice = The Field that you want to sum.

    Try it out, It will definitely work.

     

    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.

  • Verified answer
    Sid_Jafri Profile Picture
    478 on 07 Jul 2021 at 04:13:41
    Re: Sum function in a collection

    Hi @ekoz21 ,

    You better use the collection value and sum up. e.g. use the collection column name for unit price and amount
    "Total Sum, Eur: "& Sum(ColStolenArticles,  unitprice * amount)

    Or you can use

    "Total Sum, Eur: "& Sum(Gallery.AllItems, Value(Suma_lbl.Text))

     

    Make sure that Suma_lbl.Text doesn't contains text value as I seen above have some text of Sum, Eur:

    Please Thumbs up and accept as solution if my post helped you solve your issue.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard