web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to rank summed gal...
Power Apps
Unanswered

How to rank summed gallery items, help appreciated

(0) ShareShare
ReportReport
Posted on by 35

Hello, I'm trying to create a leaderboard whereby the scores are grouped by team name (TeamAliasText) and summed by points. I am able to get the gallery to group and sum. But I cannot get the ranking to work 😞

 

This is what I have under items for the gallery, 

 

SortByColumns(
 AddColumns(
  GroupBy('Game Scores',"TeamAliasText","GroupedItems"),
"Sum of Value",Sum(GroupedItems,Points)

),
"Sum of Value",
SortOrder.Descending
)

 

Current result:

Jake_Daniels_9_0-1701706754375.png

Hoping to have, ranking on the left

Jake_Daniels_9_1-1701706890208.png

Ungroup(
  ForAll(
   Sequence(CountRows('Game Scores')),
 {
myRecord: Table(
 Last(
     FirstN( Sort('Game Scores', Points, SortOrder.Descending),
  Value
)
  )
    ),
RowNumber: Value
}
 ),
"myRecord"
 )

 

I can't seem to get both of these working together.

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    You can use something like the expression below. If you "save" the sorted expression that you have, you can use a ForAll with the sequence of indices, and use the Patch function to merge the RowNumber record with the record from the sorted list.

    With(
     {
     sorted: SortByColumns(
     AddColumns(
     GroupBy( 'Game Scores', "TeamAliasText", "GroupedItems"),
     "Sum of Value",
     Sum(GroupedItems,Points)
     ),
     "Sum of Value",
     SortOrder.Descending
     )
     },
     ForAll(
     Sequence(CountRows(sorted)),
     Patch(
     { RowNumber: Value },
     Index(sorted, Value)
     )
     )
    )
    

    Hope this helps!

  • Jake_Daniels_9 Profile Picture
    35 on at

    I get you now thank you so much! It works and that makes sense. Appreciate your solution.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard