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 Apps
Answered

Nested Groupbys

(0) ShareShare
ReportReport
Posted on by 1,512

I have nested galleries and I need to do a filter where only the Equipment is displayed for the current logged in user.

 

Currently this is my GroupBy code on the Parent Gallery, I want to group also by Year, which is a field in my SharePoint list.  However, I do not know how to do the second groupby and how to use it in the child gallery.

 GroupBy(
 AddColumns(
 Filter(
 colEquip,
 User().Email=CurrentUser.Email),
 "EmpName",EmployeeName),
 "EquipmentType",
 "Data")

 

Any help would be appreciated.

Categories:
  • WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    Hi @Dorinda ,

    That gallery would be

    GroupBy(
     Data,
     "YourGroupedField",
     "Data2"
    )
    

     

    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.

    Visit my blog Practical Power Apps

  • Dorinda Profile Picture
    1,512 on at

    @WarrenBelz I thought I had to do a nested groupby on the first one in order to do the filter.  Are you saying i add that second groupby directly in the child gallery?

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

    @Dorinda ,

    Yes - the "child" gallery Items is normally ThisItem.Data, so you can further filter/group in there.

     

    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.

    Visit my blog Practical Power Apps

     

     

  • Dorinda Profile Picture
    1,512 on at

    @WarrenBelz I am sorry but I am having a brain cramp I do not understand how to do this?  Can you please tell me how to filter the User and Year?

  • Verified answer
    WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    Hi @Dorinda ,

    It would be same format as normal - you are just grouping Data

    AddColumns(
     GroupBy(
     Filter( 
     Data,
     User = . . . . & 
     Year = . . . 
     ),
     "YourGroupedField",
     "Data2"
     ),
     "YourAddedColumn",
     AddedColumnValue
    )

     

    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.

    Visit my blog Practical Power Apps

  • Dorinda Profile Picture
    1,512 on at

    @WarrenBelz  so this appears like it would go on the Parent Gallery not the child just making sure where I need to put this?

  • Verified answer
    Dorinda Profile Picture
    1,512 on at

    @WarrenBelz 

     

    Took me awhile but on the Parent Gallery I put this

    GroupBy(
     AddColumns(
     Filter(
     colEquip,
     User().Email=CurrentUser.Email),
     "EmpName",EmployeeName),
     "Purchase_x0020_Year",
     "EquipmentType",
     "Data")

    and got the result I was looking for not exactly pretty but it works

    Dorinda_0-1643669825492.png

     

     

  • Dorinda Profile Picture
    1,512 on at

    @WarrenBelz 

     

    Well heck almost worked

    Dorinda_1-1643670019741.png

     

     

    it is not breaking it completely apart.  I was so close, so I guess I need more help 😞

  • Dorinda Profile Picture
    1,512 on at

    @WarrenBelz disregard it helps if you refresh all of your data.  Thank you for your help!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard