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 Apps / Leaderboard in PowerApps
Power Apps
Answered

Leaderboard in PowerApps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to make a leaderboard in PowerApps using a Gallery. The aim is to add up the values of all entries inputted by one user and rank them based on how many "Miles" they have logged.  

 

So far, my gallery Items formula is: 

Sort(GroupBy(MilesChallenge, "Title","Miles"), CountRows(Miles), SortOrder.Descending)

 

Based on watching this video: https://www.youtube.com/watch?v=q42ibovAqZc

*Miles Challenge is my data source

 

However, instead of CountRows, I want to use Sum. 

 

Within the gallery, to add up all the Miles someone has logged I have the formula: 

Sum(Filter(MilesChallenge,Title=ThisItem.Title),Miles) & " Miles"
 
However when I try to swap CountRows(Miles) with the above formula it doesn't seem to like that and no data is shown, just a delegation warning about it potentially not working for large data sets. 
 
Can anyone help? 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    Hi @BT168 ,

    Neither Sum nor GroupBy are Delegable.

    Assuming Miles is the field name, you need

    Sort(
     AddColumns( 
     GroupBy(
     MilesChallenge, 
     "Title",
     "OtherData"
     ),
     "TotalMiles",
     Sum(
     OtherData,
     Miles
     )
     ),
     Title,
     Descending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BT168 Profile Picture
    Microsoft Employee on at

    @WarrenBelz Thank you that's worked! However when a new user adds an entry, they automatically get added to the bottom the leaderboard, regardless of if their score is the highest. Is there a formula I can put in to a refresh button on the leaderboard? 

  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    Hi @BT168 ,

    Refreshing the data source

    Refresh(MilesChallenge)

    probably should do the job - and change the filter to

    Sort(
     AddColumns( 
     GroupBy(
     MilesChallenge, 
     "Title",
     "OtherData"
     ),
     "TotalMiles",
     Sum(
     OtherData,
     Miles
     )
     ),
     TotalMiles,
     Descending
    )

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard