cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jammie1000000
Level: Powered On

Cumulative Sum - Sharepoint Lists

I have a Sharepoint list similar to the one below

 

Column 1Column 2Reset?
1158No
22856No
348916Yes
4368No
52862No
615889No
765686Yes
8656No
96591No
109982No

 

I would like to have a running total of column 2. I can do this with a calculated column that only takes the values of the "Yes" condition of the reset? column. However, I also want the last value in Column 2 - even if the reset? column is "No". 

 

Is this possible?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Cumulative Sum - Sharepoint Lists

Hi @Jammie1000000 ,

 

If you want to calculate the total of the column 2 fields contained in the Yes item, you could use Increment variable action to accumulate the value.

You could also add another branch, set Order By and Top Count in Get items action to get the value of Column 2 field contained in the last item.

 

Image reference:

19.PNG20.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Cumulative Sum - Sharepoint Lists

@Jammie1000000 

You can get to where you want to go but it will be complicated.  First, you'll need to store the total somewhere such as another SharePoint list.  Then, you'll need logic to determine whether an entry in you list is a new entry is a new entry or an update,  If it is a new entry, then you'll simply add the number into the total.  If you are modifying an existing entry, you'll need to know the previous value so that you can back it out.  To know the previous value, you'll either need to call the SharePoint API to retrieve the previous version on the list entry or store a copy of the old value in another (hidden) column in your list that will need to be updated.  Finally, you'll have an issue when/if an item is deleted.  In that case you'll need to call the SharePoint API for the previous version.  Very messy....

 

Let me know if you intend to pursue this and I'll provide resources that demonstrate how to get the previous version of a list item by calling the SharePoint API.

 

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

Scott
Community Support Team
Community Support Team

Re: Cumulative Sum - Sharepoint Lists

Hi @Jammie1000000 ,

 

If you want to calculate the total of the column 2 fields contained in the Yes item, you could use Increment variable action to accumulate the value.

You could also add another branch, set Order By and Top Count in Get items action to get the value of Column 2 field contained in the last item.

 

Image reference:

19.PNG20.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,549)