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 / Sorting and grouping d...
Power Apps
Answered

Sorting and grouping data results in Power Apps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an Excel file that has a list of sales account leads. The unique field in the data is the Full Name which is the contact manes at each of the companies. There are multiple entries for a specific Account Name - Company as I have been given multiple lead-contacts per company to reach out to. I love the new "Ideas" in Power Apps where they attempt to help users build querries but It is in it's infancy. Here is what I am trying to do:

Sort(Distinct('Table1', 'FullName'), Result, Ascending) group by AccountName.

 

I want my results to be grouped and sorted by AccountName and list the Contact names for each account within that account and each would have the usual arrow to go to the details of that unique "FullName" data entry.

 

The results should look like this:

Santa Cruz Software company (AccountName) 

Brian Jones (FullName)                                      >

David Super (FullName)                                     >

Flambeau (AccountName)

Alejandro Rosado (FullName)                            >

Basil Ledet (FullName)                                       >

Tom Kimble (FullName)                                     >

David Rutzler (FullName)                                   >

 

Is this even possible with a sort and group query or do these one-to-many relationships need to be separated into separate lists?

 

I am hoping a query can solve this because this is how we are being given the data...

 

I have attached the Excel file AccountLeads.xlsx

 

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,746 Super User 2026 Season 1 on at

    @GregoryGuth 

     

    I really hope this is sample data and You just not breached GDPR but just in case if it's not a sample remove the file and replace it with some fake data 🙂

  • Verified answer
    WarrenBelz Profile Picture
    154,496 Most Valuable Professional on at

    Hi @SebS ,

    You did not say how you connecting this, but assuming direct to the Excel file, you would have a Gallery with the Items

    GroupBy(
     Table1,
     "AccountName",
     "Data"
    )

    then a nested gallery inside this with the Items

    ThisItem.Data

    and Labels inside that for all the fields (except AccountName which is in the main gallery)

     

    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

     

  • GregoryGuth Profile Picture
    Microsoft Employee on at

    It is made up sample data. I was hoping it would help.

  • WarrenBelz Profile Picture
    154,496 Most Valuable Professional on at

    @GregoryGuth ,

    The principle is the same - just you would have different data source and field names.

     

    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

  • GregoryGuth Profile Picture
    Microsoft Employee on at

    Warren - I have this working (distinct sort 'AccountName') which gives me the first screen looking good except where I am challenged is the arrows no longer work as one account name may point to multiple user accounts. I assume I will need to create a custom next page that loads up the account details and then lists the people/contacts within that account. I am lost as to how to pass that data across and to make the initial arrow function correctly (pass on the AccountName.

  • Verified answer
    WarrenBelz Profile Picture
    154,496 Most Valuable Professional on at

    @GregoryGuth ,

    You need the GroupBy structure I posted with a nested gallery containing the Data table.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard