Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Distinct in a Gallery

I have a gallery connected to a SQL table. There are multiple columns that I want the gallery to be connected to, but 1 of those columns I want to use a distinct filter on. However when I use the distinct filter, I cannot use any of the other columns in the galley, only the resulting column from the distinct function. How can I use the distinct column and another column from the table in a gallery. 

Super User
Super User

Hi @mrizz 

To filter your gallery on a unique set of values, put a dropdown outside of the gallery and set its items property to  




Make the gallery items property:




Distinct() takes a single field in the datasource and creates a 1 column table of unique values from the selected field and names it "Result". 

If (for some reason) you want the have a dropdown inside of the gallery, you can put the same one there and change the Default to ThisItem.Column2makeUnique. 

Replace the "Column2makeUnique" above with the name of the field you are referring to.

Community Support
Community Support

Hi @mrizz :

Do you want to get the table after removing duplicate data based on a certain field.

My method is to use forall and lookup nested way to get the table:




I've made a test for your reference:

My data source:'List A'


1\Add a gallery and set it's Items property to:


ForAll(Distinct('List A',Title),LookUp('List A',Title=Result))



Duplicate records are eliminated,at the same time all fields are reserved.

Best Regards,


Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,312)