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 / Order total formula
Power Apps
Answered

Order total formula

(0) ShareShare
ReportReport
Posted on by 50

Hello

I have 2 items in my cart and their subtotals are $72.00 and $80.00 respectively.

But my order total is giving me a total of $144.00 which means it’s only summing up the first item in my cart.

How do I get it to sum all items in the cart?

Formula used.

”$”&Text(Sum(colShoppingCart,Right(SubTotal,Len(SubTotal)-1)))

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @Nneka 

     

    Try this

     

    "$" & Text(Sum(colShoppingCart, SubTotal))

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Nneka Profile Picture
    50 on at

    Hello sir,

    I already tried the above formula before and it didn’t work.

    It says the value $80.00 cannot be converted to a number.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @Nneka,

    That depends on how you set the Label of subtotals, you must have it formatted into a currecy, please post the format formula.

    I have found that you mentioned it in your previous reply, is the following how you calculate the subtotals?

    ThisItem.ItemPrice*Dropdown1.Selected.Value

     

    If so, I think you need to use the following formula:

    Text(Sum(BrowseGallery1.AllItems,Value(Body1.Text)),"[$-en-US]$##,###.00","en-US")

    Note that you need to refer to Gallery.AllItems, and the Label where you display the subtotals.

     

    vqiaqimsft_1-1697172339823.png

     

     

  • Nneka Profile Picture
    50 on at

    Hello Sir

    My subtotal is calculated as

    Text(ThisItem.ItemPrice*Dropdown1.Selected.Value,”[$-en-US]$##,###.00”, “en-US”)

    The given formula didn’t work for the order total.

     

    IMG_0372.png
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @Nneka,

    Just roll back to the original version, add another label within the Gallery and set it as below formula, you could make this label invisible

    ThisItem.ItemPrice*Dropdown1.Selected.Value

    Remember this new label name, then 

    Text(Sum(BrowseGallery1.AllItems,Value(NewLabel.Text)),"[$-en-US]$##,###.00","en-US")

     

    I use this because you are not referring to the data from the same source, so make the format string roll back to the original version.

     

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @Nneka 

     

    @v-qiaqi-msft given formula works fine in my side.

    If doesn't work, try this formula.

     

    If the 'SubTotal' field contains non-numeric values or empty strings, you can use the IfError function to handle those cases

     

    Text(Sum('Checkout Gallery'.AllItems, IfError(Value(SubTotal.Text), 0)),"[$-en-US]$##,###.00","en-US")

     

    IfError(Value(SubTotal.Text), 0): This part handles potential errors by using IfError.

    If there's an error converting SubTotal.Text to a number, it will default to 0.

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • Nneka Profile Picture
    50 on at

    This didn’t work

    It only made my order total to become 0

  • Nneka Profile Picture
    50 on at

    Please explain further.

    Which original version and how do you mean make it invisible?

  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

    Try this one

     

    Text(Sum('Checkout Gallery'.AllItems, Value(Substitute(SubTotal.Text, "$", ""))),"[$-en-US]$##,###.00","en-US")

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Nneka Profile Picture
    50 on at

    Yaay!!!

    Thank you so much Sir.

    The formula worked.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard