cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TechNewbie
Level: Powered On

GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

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

Thank you!

4 REPLIES 4
Super User
Super User

Re: GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

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
Level: Powered On

Re: GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

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

Community Support Team
Community Support Team

Re: GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

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,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: GROUP BY, SORTBYCOLUMNS, DISTINCT, FILTER

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

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 68 members 3,716 guests
Please welcome our newest community members: