cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cooper33
Resolver III
Resolver III

How to calculate total of a SharePoint column?

Feel like this should be way easier than I'm making it but I can't get this to work. I want to calculate a running total of the values in a column called Hours in a SharePoint list. This column may or may not be empty. Here is what my flow is doing

1. Initialize variable (runningTotal, Float type)

2. Get items from SharePoint list

3. Apply to each value (from Get items)

4. Increment variable runningTotal, Value = Hours (from Dynamic content)

 

Issue is that the runningTotal is the evaulating to the total number of the items in the list. When I walk through the loop, it increments by 1 for each item in the SP list from Get items

I tried adding a Condition to attempt to only add when the Hours field is not null, but I don't think I'm doing that right with the new Flow upates. I tried Hours  is greater than 0, which failed on the items where Hours was null. I tried Hours is not equal to '' which still counted everything.

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for the response. The configuration in your screenshot is what I had and was trying to describe. It was only incrementing by 1 and not taking into the account of the field in the loop.

I had to add a Condition to the loop to check if the field was not equal to null. If Yes, I incremented the value as shown in your screenshot.

View solution in original post

3 REPLIES 3
ScottShearer
Super User
Super User

@cooper33 :

 

Please post a screen shot of your Flow - that will make it much easier to assist.

 

Here is an example of now you might approach your issue.

I have a list with a number column call Available Quantity.

The Flow below loops through the list and adds the Available Quantity in each row to the variable.

When the Flow is complete, the variable holds the total of all values in the Available Quantity column.

 

iNCREMENT.jpg

 

If this addresses your issue, please mark you post as Solved.

 

Scott

 

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

Scott

Thank you for the response. The configuration in your screenshot is what I had and was trying to describe. It was only incrementing by 1 and not taking into the account of the field in the loop.

I had to add a Condition to the loop to check if the field was not equal to null. If Yes, I incremented the value as shown in your screenshot.

View solution in original post

Can you supply a screenshot.  No matter what I do I still only get increment by one

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.

Users online (1,280)