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 / Calculate values in a ...
Power Apps
Answered

Calculate values in a gallery

(0) ShareShare
ReportReport
Posted on by 1,097

I have a gallery with numbers and category to each number.

 

How can i sum each row with category A and sum each row with category B and multiply each category C value with the current sum of a and b? 

 

I need a code that work through each row in the gallery and do stuff based on what category each row have. 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @Oskarkuus ,

    I am a little confused with your description - is Category a number field? If so (and the same for B)

    Sum(
     GalleryName.AllItems,
     CategoryA
    )

    The total would be

    Sum(
     GalleryName.AllItems,
     (CategoryA + CategoryB) * CategoryC
    )

     

    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.

    Visit my blog Practical Power Apps

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Oskarkuus ,

     

    As @WarrenBelz said, your description is a little confused to me as well. Could you please share more details of your scenario? It would be much better for you to attach some screenshots and describe more clearly. I tried to make some assumptions however they all seemed not exactly meet your demand.

     

    Below is one of those assumptions:

    I have a list with a number column as well as a Category Choices column:

    vjefferni_0-1639036763057.png

    The label to display multiply results within the Gallery, Text property

    If(
     ThisItem.Category.Value = "C",
     Sum(
     Filter(
     test1,
     Category.Value = "A"
     ),
     NO1
     ) * Sum(
     Filter(
     test1,
     Category.Value = "B"
     ),
     NO1
     ) * ThisItem.NO1
    )

     

    A Gallery connecting to this list, the Label displays the counting result:

    vjefferni_1-1639036816379.png

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find 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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 400 Most Valuable Professional

#2
11manish Profile Picture

11manish 141 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard