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

Combining Filter and group by in Gallery

How can ı use filter and group by together in gallery. My code part like that

Filter(
MyDatabase;
SearchBox.Text in 'EmployeeName' || SearchBox.Text in 'Number' 
)

I want also group by with employeename. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Combining Filter and group by in Gallery

Hi @tugba ,

Do you want group result displaying three columns?

If so, try this formula:

ForAll(
GroupBy( Filter( MyDatabase; SearchBox.Text in 'EmployeeName' || SearchBox.Text in 'Number' ),"EmployeeName","info"),
AddColumns(info,"EmployeeName",EmployeeName)
)

 What's more, which field do you want to not display duplicate data?

I suggest you use the Distinct function.

Just use Distinct(table,fieldname).

Distinct returns a one-column table that contains the results, with duplicate values removed.

Here's a doc for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-distinct

 

 

Best regards,

Community Support Team _ Phoebe Liu

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

View solution in original post

7 REPLIES 7
Dual Super User
Dual Super User

Re: Combining Filter and group by in Gallery

It should look something like this:

GroupBy(
Filter(
MyDatabase;
SearchBox.Text in 'EmployeeName' || SearchBox.Text in 'Number' 
), 'EmployeeName')


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
tugba
Level: Powered On

Re: Combining Filter and group by in Gallery

I tried already but I want to appear 3 different column in gallery. With these code it didn't work
Dual Super User
Dual Super User

Re: Combining Filter and group by in Gallery

Do you mean you want to group by three columns or you want three columns to appear in each group?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
tugba
Level: Powered On

Re: Combining Filter and group by in Gallery

I want three columns to appear in each group. I filtered gallery with searchbox now but there is a duplicate datas.  I don't want duplicate data to appear in gallery



 

Community Support Team
Community Support Team

Re: Combining Filter and group by in Gallery

Hi @tugba ,

Do you want group result displaying three columns?

If so, try this formula:

ForAll(
GroupBy( Filter( MyDatabase; SearchBox.Text in 'EmployeeName' || SearchBox.Text in 'Number' ),"EmployeeName","info"),
AddColumns(info,"EmployeeName",EmployeeName)
)

 What's more, which field do you want to not display duplicate data?

I suggest you use the Distinct function.

Just use Distinct(table,fieldname).

Distinct returns a one-column table that contains the results, with duplicate values removed.

Here's a doc for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-distinct

 

 

Best regards,

Community Support Team _ Phoebe Liu

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

View solution in original post

Administrator
Administrator

Re: Combining Filter and group by in Gallery

Hi @tugba how are you progressing with this? Was the above reply helpful?

 

@TopShelf-MSFT 

tugba
Level: Powered On

Re: Combining Filter and group by in Gallery

Hi

yes it was helpful to me thanks.

tugba

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 232 members 6,758 guests
Please welcome our newest community members: