cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jayant_2203
Helper II
Helper II

Sum of Multiplicated Columns

Hi All,

I have a small requirement which i would like to achieve through PowerAutomate. 

Data source is SharePoint.

 

So currently I have 4 Columns Quantity , Supplier 1 , Supplier 2 , Supplier 3 and all of them are of type number. Now what i would like to achieve is to multiply Quantity * Supplier 1  , Quantity * Supplier 2 , Quantity * Supplier 3 and then Sum of (Quantity * Supplier 1) , Sum of ( Quantity * Supplier 2 ) , Sum of ( Quantity * Supplier 3 ). 
Now it can be a case where in Supplier 1 , Supplier 2 , Supplier 3  values can be multiple. 
Example 

QuantitySupplier 1 Supplier 2Supplier 3
20102030
10201020

 

Now what i would like to achieve is the final output marked in bold :

Sum of ( Quantity * Supplier 1 )  = 400

Sum of ( Quantity * Supplier 2 )  = 500

Sum of ( Quantity * Supplier 3 )  = 800

 

How can I achieve this? Would appreciate any help!

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Community Champion
Community Champion

I'm not sure I understand the question.

The three variables used in the flow will store the Quantity * Supplier totals.

ekarim2020_2-1633169736259.png

You can use the variables at the end of the flow, after the Apply to each loop has completed. I have added a SumAll variable:

2021-10-02_11-28-20.jpg

The new output is:

2021-10-02_11-06-23.jpg

 

The updated flow actions are:  The Sum All variable and the message in the compose action:

ekarim2020_4-1633170316956.png

These are the details of the actions, which I added to the end  of the flow:

2021-10-02_11-20-08.jpg

 

 

 

add(add(variables('varSumSupplier1'),variables('varSumSupplier2')),variables('varSumSupplier3'))

 

You have access to the values stored in the variables using Dynamic content:

 

2021-10-02_11-33-26.jpg

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
ekarim2020
Community Champion
Community Champion

Here is one method you could use. Based on the following demo SharePoint List:

ekarim2020_1-1633126697121.png

we can produce the following message:

ekarim2020_11-1633127843443.png

using this flow:

2021-10-01_23-32-19.jpg

Here is the flow showing more details:

ekarim2020_0-1633126610431.png

ekarim2020_2-1633126757172.png

ekarim2020_3-1633126830646.png

 

ekarim2020_8-1633127495784.png

The expressions used above are shown here:

2021-10-01_23-20-21.jpg

Hope this helps.

Ellis

 


____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

@ekarim2020 Thank you for the reply and solution. 
I applied your solution and i am getting the multiplied values but at the end of it i would want to sum all Suplier1 values , Supplier 2 Values and Supplier 3 Values separately in different variables so that i can use it in further flows.
Currently i am getting the multiplied values in applied to each for 3 different items i want to sum those 3 values. How can i do this?

Jayant_2203_0-1633164963759.png

Jayant_2203_1-1633164975738.pngJayant_2203_2-1633164990286.png

 

  

ekarim2020
Community Champion
Community Champion

I'm not sure I understand the question.

The three variables used in the flow will store the Quantity * Supplier totals.

ekarim2020_2-1633169736259.png

You can use the variables at the end of the flow, after the Apply to each loop has completed. I have added a SumAll variable:

2021-10-02_11-28-20.jpg

The new output is:

2021-10-02_11-06-23.jpg

 

The updated flow actions are:  The Sum All variable and the message in the compose action:

ekarim2020_4-1633170316956.png

These are the details of the actions, which I added to the end  of the flow:

2021-10-02_11-20-08.jpg

 

 

 

add(add(variables('varSumSupplier1'),variables('varSumSupplier2')),variables('varSumSupplier3'))

 

You have access to the values stored in the variables using Dynamic content:

 

2021-10-02_11-33-26.jpg

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,621)