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

Groupby Column

(0) ShareShare
ReportReport
Posted on by 89

I created a gallery called GLDatatable and I am trying to group the last column, Status, of the table to show Project Status. But instead of grouping this column by Active, Closed, Cancelled, or Hold, it places the status across all my columns horizontally. The groupby format I'm using is in red below:  Without the Groupby, my formula works perfectly for what I'm trying to do.

 

Here is an example without Groupby.

David8_0-1616162008786.png

And here is my code. When I add the Groupby in Red, groupby is not working properly

 
Groupby(
Filter(
Switch(
locSortColumn,
"Title", Sort(ccCatalog, 'Project Name', If(locSortAscending, Ascending, Descending)),
"ISSR Number", Sort(ccCatalog, 'ISSR Number', If(locSortAscending, Ascending, Descending)),
"Your Department", Sort(ccCatalog, 'Your Department', If(locSortAscending, Ascending, Descending)),
"Your Name", Sort(ccCatalog, 'Your Name', If(locSortAscending, Ascending, Descending)),
//"Project Status", Sort(ccCatalog, ProjectStatus.Value, If(locSortAscending, Ascending, Descending)),
ccCatalog
),
User().FullName in TISO,
Created >= DPStartDT.SelectedDate && Created <= DPEndDT.SelectedDate,
TXSearchDT.Text in 'ISSR Number' || TXSearchDT.Text in 'Project Name' || TXSearchDT.Text in TISO || TXSearchDT.Text in 'Your Name' || TXSearchDT.Text in 'Your Department',
If(IsBlank(DDProjectStatusDT.Selected.Value), true, 'Project Status'.Value = DDProjectStatusDT.Selected.Value)
),
"Project Status",
"GRPStatus"
)

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @David8 

    Please consider changing your Formula to the following:

    With({_usr: User().FullName},
    
     GroupBy(
     Filter(
     SortByColumns(ccCatalog,
     Coalesce(locSortColumn, "Title"),
     If(locSortAscending, Ascending, Descending)
     ),
     _usr in TISO &&
     Created >= DPStartDT.SelectedDate && Created <= DPEndDT.SelectedDate &&
     (IsBlank(TXSearchDT.Text) || TXSearchDT.Text in 'ISSR Number' & 'Project Name' && TISO && 'Your Name' & 'Your Department') &&
     (IsBlank(DDProjectStatusDT.Selected.Value) || 'Project Status'.Value = DDProjectStatusDT.Selected.Value)
     ),
     "Project Status",
    	"GRPStatus"
     )
    )

     

    I hope this is helpful for you.

  • Verified answer
    David8 Profile Picture
    89 on at

    Randy, 

    This didn't work for me when I applied it but I knew immediately that I was doing something wrong with my gallery. So I spent some time learning about With, Coalesce, and Groupby and changed what I was trying to do to a table. Reapplied it to my datatable and it worked perfectly without any changes. Thanks again for all 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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard