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 / Implement Aggregations...
Power Automate
Answered

Implement Aggregations on SharePoint List Data(Sum ,Group By)

(1) ShareShare
ReportReport
Posted on by 109

SharePoint List have Column like Name,Email,TotalPoints.I want to sum the TotalPoints by Grouping them by Email.After that sort the sum(TotalPoints ) in desc order,How can i do it in Power Automate

Categories:
I have the same question (0)
  • Verified answer
    Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at

     

    Chriddle_0-1721035884916.png

     

    Compose (Test Data)

     

    [
    	{"Name":"Jim","Email":"jim@example.com","Score":9},
    	{"Name":"Jim","Email":"jim@example.com","Score":1},
    	{"Name":"John","Email":"john@example.com","Score":7},
    	{"Name":"Jim","Email":"jim@example.com","Score":19},
    	{"Name":"Jane","Email":"jane@example.com","Score":1},
    	{"Name":"Jim","Email":"jim@example.com","Score":5},
    	{"Name":"John","Email":"john@example.com","Score":3},
    	{"Name":"Jane","Email":"jane@example.com","Score":7}
    ]

     

     

    Select

    From (Get list of unique EMails)

     

    union(	
    	xpath(
    		xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
    		'//Item/Email/text()'
    	),
    	json('[]')
    )

     

    Map EMail

     

    item()

     

    Map TotalScore (Calulate the sum of Scores per EMail)

     

    xpath(
    	xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
    	concat('sum(//Item[Email="',item(),'"]/Score)')
    )

     

     

    Compose 2 (sort them desc)

     

    reverse(sort(body('Select'), 'TotalScore'))

     

     

    Result:

     

     

    [
     {
     "EMail": "jim@example.com",
     "TotalScore": 34
     },
     {
     "EMail": "john@example.com",
     "TotalScore": 10
     },
     {
     "EMail": "jane@example.com",
     "TotalScore": 8
     }
    ]

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard