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:
I have the same question (0)
  • Chriddle Profile Picture
    8,697 Super User 2026 Season 1 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,697 Super User 2026 Season 1 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 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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 470

#2
Haque Profile Picture

Haque 416

#3
David_MA Profile Picture

David_MA 344 Super User 2026 Season 1

Last 30 days Overall leaderboard