cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tagustin2020
Impactful Individual
Impactful Individual

Multiply the value of an item times the quantity - display extended total

@RandyHayes 

 

Hello Randy,

 

Another question for my Shipping app. I would like to multiply the value field times the quantity field to come up with an extended total for each line item that is entered. The Default property of my Total text input control is "$" & Text("0.00") which clearly only affects the way the number looks. How do I add a math component to it? More screenshots are attached in the Word doc. Thanks in advance for your help. Teresa

 

MathCalcSS.png

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@tagustin2020 

I'm a little confused on the question.   You mention the calculation but your doc seems more focused on the Total at the bottom.  Perhaps there are two questions here.

 

So, if you want the Total to be based on the Value and the Qty, then typically you would NOT have a TextInput control for your Total, you would do what you mention...base total on Value * Qty.

So your Label (not textinput) would have a text property of 

    Text(Value(yourValueInput.Text) * Value(yourQtyInput.Text), "$#,##0.00")

There is no need to put this in your collection.

I would extend this to your Gallery as well.  With the Total label having the same formula (except relating to the labels in the Gallery row instead of the TextInput controls).

Finally, your Total label at the bottom can be:

   Text(Sum(yourGallery.AllItems, Value(yourTotalLabel.Text)), "$#,##0.00")

 

I hope this is helpful for you.

 

Personally, I would skip the collection as your source of total values and instead make your Total label be based on the Gallery.

Your 

   Text(Sum(yourGallery, TotalAmount

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@tagustin2020 

I'm a little confused on the question.   You mention the calculation but your doc seems more focused on the Total at the bottom.  Perhaps there are two questions here.

 

So, if you want the Total to be based on the Value and the Qty, then typically you would NOT have a TextInput control for your Total, you would do what you mention...base total on Value * Qty.

So your Label (not textinput) would have a text property of 

    Text(Value(yourValueInput.Text) * Value(yourQtyInput.Text), "$#,##0.00")

There is no need to put this in your collection.

I would extend this to your Gallery as well.  With the Total label having the same formula (except relating to the labels in the Gallery row instead of the TextInput controls).

Finally, your Total label at the bottom can be:

   Text(Sum(yourGallery.AllItems, Value(yourTotalLabel.Text)), "$#,##0.00")

 

I hope this is helpful for you.

 

Personally, I would skip the collection as your source of total values and instead make your Total label be based on the Gallery.

Your 

   Text(Sum(yourGallery, TotalAmount

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Hi Randy,

 

Thanks for the advice! The formulas as working perfect!

Shipping Contents SS.png

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,007)