web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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
    153,084 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard