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 / Dynamically Multiply V...
Power Apps
Unanswered

Dynamically Multiply Values Selected from a Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey there!

 

I have a vertical gallery that is pulling from Azure SQL DB, and one of the sub-values is a number.  I have checkboxes in every line of the gallery.  My goal is to have users select items from the list with the check boxes, and then multiply the values that they selected and show them in a text label.

 

I have been playing with collections and variables, but can't figure out how to run equations on numerous variables, or which there may be various numbers of variables. Any help would be appreciated!

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nihei 

    No collections or variables needed.  Your Gallery already is a table (collection) of records.

     

    Set your Label Text property to:

       Sum(Filter(yourGallery.AllItems, yourCheckBox.Value), yourValueColumn)

     

    I hope this is helpful for you.

  • nihei Profile Picture
    Microsoft Employee on at

    Gotcha, makes sense! That is helpful.  What function would you recommend using for multiplication of values though, rather than sum?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nihei 

    Well that depends on what you want to multiply!  

    Are you trying to multiply certain columns of each record/row together and then produce a sum of those, or are you trying to get a sum of the records/rows and then multiply that by something else?

  • nihei Profile Picture
    Microsoft Employee on at

    I want to multiply the values of each record by each other.  They are availability times of services so say -

    Service A - 99.9%

    Service B - 99.95%

    Service C - 99%

     

    Each line would have a check box, so I want to be able to multiply whichever selections are made by each other to create a composite score.  Say A and C are selected, it would be 98.9%.  I just don't know how to do this will n number of selections from the gallery

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nihei 

    I'm not entirely following what you want to multiply then.  Are you stating that Service A, B and C are options (checkboxes) in EACH row/record?  Or is that what your Gallery is comprised of - rows/records that are Service A, B and C?

     

    And can you explain how having A and C selected would provide 98.9%?  What is your math to get to that?

  • nihei Profile Picture
    Microsoft Employee on at

    So the gallery is comprised of rows - Service A, B, C, etc. that each contain a check box that a user can select.  The math in my example is simply the SLA of Service A * the SLA of Service C / 100.  So (99.9*99)/100.  I have figured out how to do this easily with text inputs but I want to be able to do this with n number of selections from the gallery.

     

    nihei_0-1645213958361.png

     

    Thanks for the help!

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nihei 

    I guess I am still a little confused because you are mentioning 99.9% and 99%

    I see the 99.9% in your gallery, but where are you deriving the 99% from?  Is that a standard value or something that comes from someplace else?

  • nihei Profile Picture
    Microsoft Employee on at

    Gotcha, yeah I was just using those values as examples, but those values are stored in my table in Azure SQL 🙂 That is the source of data for the gallery at the moment.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nihei 

    The challenge with this is that there is no function in PowerApps that will multiply a list of numbers.

    Are you trying to achieve an average or is that really the math you need to use?

  • nihei Profile Picture
    Microsoft Employee on at

    That's what I figured, I didn't see anything like that in the documentation.  I do need the math like that to calculate a composite SLA.  I was fiddling around with some kind of ForAll loop that goes through the contents of the table and stores the updated value to a variable, but no luck yet.  Let me know if you have any additional ideas 🙂

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 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard