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 / GROUP BY, SORTBYCOLUMN...
Power Apps
Unanswered

GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

(0) ShareShare
ReportReport
Posted on by 6

Hi, Just wanted to ask if it is possible to combine GROUP BY, SORTBYCOLUMNS, DISTINCT and FILTER in a single statement. 

Thank you!

Categories:
I have the same question (0)
  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @TechNewbie 

    Technically, there's no reason why you can't combine all of those in a single statement.

    If you're working with a remote data source like SharePoint/SQL Server, the resulting formula will most likely not be delegable. This means that with larger recordsets, the result may not include all your intended results.

  • TechNewbie Profile Picture
    6 on at

    Hi @timl, Thanks! Got it. So that is the caveat in using it all at once. 

     

    The data is stored in a SharePoint list.

    SampleColumn.PNG

    I would like to filter the rooms. Remove all rooms that are already Occupied then show only available room timeslots for booking. Can you advise the best approach for my dilemma? Thank you!

     

    ScreenShot.PNG

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @TechNewbie ,

    Could you please share a bit more about your scenario?

    Do you want to show only available room timeslots for booking for a selected Room in your Gallery?

    Do you add another list to list all avaialble timeslots records?

    Further, could you please share more details about the formula you typed within the Rooms Gallery?

     

    I assume that you add another list to list all available timeslots records for each ROOM, is it true? Based on the needs that you mentioned, please consider take a try with the following workaround:

    Set the Items property of the Timeslots Gallery to following formula:

    Filter(
     'Your Timeslots List',
     Not(
    Text(TimeslotsColumn) in Concat(Filter(RoomDetails, Room_Name = Gallery_SelectRoom_2.Selected.Result), StartTime & ";")
    ) )

    Note: The TimeslotsColumn represents the column in your 'Your Timeslots List' to store the timeslots value, e.g. 7:00:00 AM, 7:30:00 AM, ...  3:00:00 PM, 3:30:00 PN, ...

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

     

  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @TechNewbie 

    If I understand you correctly, I think you can accomplish this without needing to combine all of those functions into a single formula.

    Using the screen layout that you already have, you can just filter your gallery controls and cross reference the other screen controls where appropriate.

    From a high level, the approach would look something like this. Hope that makes sense.

     

     

     

    image.png

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard