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 / Display most repeated ...
Power Apps
Unanswered

Display most repeated value in list

(0) ShareShare
ReportReport
Posted on by 6

Hi All,

 

Looking for some formula help please. I want to display the name of the person who has been assigned the most number of items in a SP list (most repeated value) . My data is in a collection - had a little joy with First / Distinct but the result is not quite correct so I suspect I'm missing something else, or I'm barking up totally the wrong tree.

 

Any help greatly appreciated!

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Gallery Item Code:

     

    GroupBy(AddColumn(ListName,"PersonTxt",PeasonColumn.DisplayName),"PersonTxt","DATA")

     

    Insert two labels in gallery.

    First label text property: ThisItem.PersonTxt

    Second Label Text Property: CountRows(DATA)

  • Hartski Profile Picture
    6 on at

    Thanks but its not quite getting me where I want to be. 

     

    I'm just looking for a single label outside of a gallery, which displays the most repeated value in the collection. This gives me a gallery with the counts of each which is fine, but I only want the largest repeated value. I can't seem to sort or extract a single value from the gallery.

     

    In my collection the basic schema is something like:

     

    Item   ---   Person

    1               John

    2               John

    3               Jane

    4               Mike

    5                John 

     

    I just want a single label that says "John has been assigned the most items"

     

    Cheers!

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Take a label outside gallery. set it's text as

    Max(Gallery1.AllItems,Title1.Text)

     

    Title1 is the name of the label which contains countrows(DATA)

  • Hartski Profile Picture
    6 on at

    That provides the number, not the name. 

     

    Hartski_0-1632404294790.png

    I want the label that says 35 to say 'Alison' (as that's the person with 35 items)

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    a2.jpga.jpg

     

    Ok. I finally got it. instead of writing this code in a gallery. Write it on a button. That will create collection. then on the label you can write this lookup that will display name of the person who has highest counts. Also instead of button you can write this collection code on App.OnStart. That way your label will be always updated when you reload the code. And show you whoever has the highest count when you open the app

  • Hartski Profile Picture
    6 on at

    That's throwing me a few errors - I think your test is using a single line of txt field for the person name ? When I get to the GroupBy section, it will only let me select ID from the collection (which is the only non-complex field in the collection)

    My list of people have come directly from a Person field in SharePoint.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard