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 / Sort column by most co...
Power Apps
Unanswered

Sort column by most common value powerapps and return list in descending order

(0) ShareShare
ReportReport
Posted on by

I'm trying to:

 

- Pull two columns from a table,

- Filter a column  "crd2e_toola" by a separate value "crd2e_prefix"

- Count the occurrences of all remaining values in column "crd2e_toola"

- Sort the remaining values from most to least common

- Return the sorted distinct values to use in a drop down box

 

Having trouble getting this to work, and I feel like it's something simple I'm missing. Thank you!

 

Screenshot 2023-02-14 081304.jpg

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,491 Most Valuable Professional on at

    Hi @jfsrc ,

    You are missing the grouped column in GroupBy.

    ClearCollect(
     toola_list,
     SortByColumns(
     AddColumns(
     GroupBy(
     ShowColumns(
     Filter(
     jareds_sandboxes,
     prefix = lbl.Selected.Value
     ),
     "crd2e_prefix",
     "crd2e_toola"
     ),
     "crd2e_prefix",
     "Data"
     ),
     "toolcounted"
     CountRows("Data")
     ),
     "toolcounted",
     Descending
     )
    )

    Also, can you please remember to post your code in Text as it saves re-typing here. This code is OCR'd, so please watch spelling.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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 Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 387

#3
timl Profile Picture

timl 344 Super User 2026 Season 1

Last 30 days Overall leaderboard