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 Automate / Flow to Sum Values on ...
Power Automate
Unanswered

Flow to Sum Values on Sharepoint Based on Conditions

(0) ShareShare
ReportReport
Posted on by 2

I have seen previous examples of flows that add up all values based on a group in a sharepoint list and then deposit the sum into a column in a different sharepoint list, but I was wondering how I might build a flow when there are multiple conditions.  

 

To Illustrate, Here's the list I start with:

JJJJLow_0-1692023879173.png

And every time I update or add a row, I want the flow to update and sum up based on the conditions of name and activity. 

JJJJLow_1-1692023933578.png

In previous posts, the addition was only based on one condition such as name, but I was wondering if it would be possible to also include a choice column all in one flow, or I would have to do a new flow for each choice (which seems rather wasteful)

 

Categories:
  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    Doing the addition is one select action:

    Chriddle_0-1692028804045.png

    With From:

     

    sort(
    	union(	
    		xpath(
    			xml(json(concat('{"root":{"item":', outputs('Data'),'}}'))),
    			'//Name/text()'
    		),
    		json('[]')
    	)
    )

     

     Name:

     

    item()

     

    Sleep:

     

    xpath(
    	xml(json(concat('{"root":{"item":', outputs('Data'),'}}'))),
    	concat('sum(//item[Name="', item(),'" and Activity="Sleep"]/Time)')
    )

     

    Other properties are the same (substituting the activity accordingly)

     

    Output:

     

    [
     {
     "Name": "Duke",
     "Sleep": 5,
     "Exercise": 0,
     "Eating": 4
     },
     {
     "Name": "Joe",
     "Sleep": 12,
     "Exercise": 16,
     "Eating": 0
     },
     {
     "Name": "Nancy",
     "Sleep": 0,
     "Exercise": 0,
     "Eating": 2
     }
    ]

     

  • JJJJLow Profile Picture
    2 on at

    Thank You. While this does work to get the desired output, my goal was to do this but also maintain two separate sharepoint lists.

  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    For example, you can read the Data from one Sharepoint list every evening with a scheduled trigger and post the Output to another Sharepoint list.

  • AgnieszkaPoland Profile Picture
    50 on at

    Hi @JJJJLow 

    Did you manage to find any solution? I have very similiar flow to build and looking for the solution for almost 2 weeks. Still not able to build any flow succesfully... will be grateful for any suggestions! 

     

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard