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 / 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)
  • Verified answer
    WarrenBelz Profile Picture
    153,495 Most Valuable Professional on at

    @GregoryGuth ,

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

  • 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.

  • WarrenBelz Profile Picture
    153,495 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

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

  • Verified answer
    WarrenBelz Profile Picture
    153,495 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

     

  • SebS Profile Picture
    4,686 Moderator 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 🙂

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
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard