cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter function and Distinct function in Gallery

Hello community,

Currently i've got into a problem.

I have a collection named Artcollection with Description and Picture columns. After filtered the Description column, there are still a few duplicate results.

I want to only show Picture column as the first image item according the return results of a de-duplicate and filtered Description column.

I tried this on the gallery:

 

Distinct(Filter(Artcollection,'things  to filter'=true),Description)

 

  This on the image item property:

 

Thisitem.Picture

 

 

Do anyone know how to fix this? Great thanks!!!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous ,

Do you want to get de-duplicate Description column and display picture column with it?

Firstly, let me explain why you could not get picture:

Distinct(Filter(Artcollection,'things  to filter'=true),Description)

This formula will return a table with column named Result with the value of  de-duplicate Description.

There's no picture column anymore.

I suggest you use GroupBy function instead of Distinct function, which will still have the value of picture column.

Try this formula in your gallery's Items:

AddColumns(GroupBy(Filter(Artcollection,'things  to filter'=true),"Description","samedes"),"pic",First(samedes).Picture)

Then the pic column will be the value of the first image that the description has.

set the image item property:

Thisitem.pic

 

 

 

Best regards,

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

5 REPLIES 5
eka24
Super User
Super User

Do you have true or false in the 'thin ge'

Column?

 

Also can you explain further

I want to only show Picture column as the first image item according the return results of a de-duplicate and filtered Description column.

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Yes I do have the true false value one the column 'things to filter',

I can explain more detail,

In the Artcollection collection there are couple columns like Description and Image and ReliefSociety

Right now i want to filter Description column by lookup ReliefSociety boolean value.

After that I need to de-duplicate the Description column and display the image item in the gallery.

Capture2.JPGCapture1.JPG
But it came out error

Hi @Anonymous ,

Do you want to get de-duplicate Description column and display picture column with it?

Firstly, let me explain why you could not get picture:

Distinct(Filter(Artcollection,'things  to filter'=true),Description)

This formula will return a table with column named Result with the value of  de-duplicate Description.

There's no picture column anymore.

I suggest you use GroupBy function instead of Distinct function, which will still have the value of picture column.

Try this formula in your gallery's Items:

AddColumns(GroupBy(Filter(Artcollection,'things  to filter'=true),"Description","samedes"),"pic",First(samedes).Picture)

Then the pic column will be the value of the first image that the description has.

set the image item property:

Thisitem.pic

 

 

 

Best regards,

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.
Anonymous
Not applicable

That works!! Thank you so much ! Sorry for the blurry explanation Haha  

Anonymous
Not applicable

Thanks for the help, however since i input code

AddColumns(GroupBy(Filter(Artcollection,Office=true),"Title","Description"),"FirstPicture",First(Description).'Photo with Frame')

, I cannot use my original Collect() function. How can I lookup current Selecteditem's "Description" name  in another collection and display the results on a new Gallery/Table ?


Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,906)