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 Product - Mu...
Power Apps
Answered

Calculate Product - Multiply all numbers in a collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need to calculate the product of a collection.
In Excel I'd use the Product function, in Power BI ProductX but I cannot see the appropriate function in Apps.
Can anyone shed light on how this may be done? I thought a ForAll may be the answer but as the result is recursive I seemed unable to get it done.

FYI product is the multiple of all numbers. So a 5 row tables product would be each row * by the next row in sequence.

Cheers

Categories:
  • eka24 Profile Picture
    20,925 on at
    In powerapps you can create a collection OnVisible, Onstart, OnSelect of a button as:
    ClearCollect(CollectionTable,AddColumns(YourTable,"ProductColumn",crewColumn*MarksColumn))
     
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the suggestion. I cant see how that would work as your simply multiplying column A by column B. I need to multiply Row A by Row B by Row C etc.

  • eka24 Profile Picture
    20,925 on at

    Where do you want to place the result. Also can you give a sample table and the result you expect?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Yes, there is no such function to multiply many values in PowerApps, the only way I come out is to use ForAll function to multiply each value one by one in the loop.

     

    since variable is not supported in ForAll function, we need to use collection to store the multiplied value. Please try this:

    ClearCollect(colTotal,{total:1});
    ForAll(YourCollection,Patch(colTotal,First(colTotal),{total:First(colTotal).total*YourNumberColumn})) 

    Then the total value is in the first line of colTotal collection.

    Snipaste_2020-05-15_13-53-24.png

    Hope this helps
    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you that's the ticket!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard