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 Apps
Answered

Running Total

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I'm new to powerapps and can't figure out how I would go about creating a running total in a gallery. I'm creating a washout book which essentially tracks the value of traded in pieces of equipment. The gallery contains these rows: Description, Expense, Revenue.

 

I would like to be able to have a running total on the far right, and while I can figure out how to calculate the total per row, I'm not sure how I would go about carrying the total over to the next row so I can include it in the next total value. What I would like to achieve is something like this:

 

Description      Expense     Revenue     Running Total

 

Unit 1              $-1000.00  |   $0.00       |   $-1000.00

Payment                 0.00   |   $500.00    |     $-500.00

Repair               $200.00   |   $0.00        |    $-700.00

 

Any input would be greatly appreciated. 

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi jmills45,

     

    What’s the data source your app based on?


    Could you show me more details about the data source?


    If all the three rows are in same card, you would consider to use Sum function using the label for each column.


    About Sum function, please check it at here:
    https://powerapps.microsoft.com/en-us/tutorials/function-aggregates/

     

    Best regards,
    Mabel Mao

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @jmills45 

    Hello there!  I would suggest inserting a new label into the gallery.  Then you could calculate the running total by using this code in the label's Text property.

     

     

    Sum(Filter(your_sharepoint_list, Created<=ThisItem.Created), Revenue)
    + Sum(Filter(your_sharepoint_list, Created<=ThisItem.Created), Expense)
    

     

     

    You did not specify which column you want the running total performed on so I will assume you want it in the order the rows were created.  The resulting gallery would be:

    Description Expense Revenue Running Total
    Unit 1 -1000 0 -1000
    Payment 0 500 -500
    Repair 200 0 -700

     

     

     

    If you'd like to see some simpler examples of how to do a running total you can check out the article below.

     

    Link To Article:
    https://matthewdevaney.com/power-apps-running-totals-in-a-gallery/


    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard