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 / Distinct Filter Gallery
Power Apps
Unanswered

Distinct Filter Gallery

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

How do I turn the following into a distinct filter of the Gallery.

Goal: If the ComboBox is blank filter the list for all, but only one item of each, not all items of each.

A person may be on the list several times, but I only want to see each of their names once in the Gallery if the ComboBox is blank; Preferably the first record associated with their name.

The following returns all instances of all names in descending order if the ComboBox is blank, and all instances of ONLY the name chosen in the ComboBox if a name is selected. The second part of the formula is working; The first part should only return one instance of each person in descending order.

     If(IsBlank(ComboBox1.Selected.Value),Filter(Collection,Title,SortOrder,Descending),
     Filter(Collection,Title=ComboBox1.Selected.Value))

Categories:
I have the same question (0)
  • HectorOlivos Profile Picture
    411 on at

    Can you try with this 

     

    If(
     IsBlank(ComboBox1.Selected.Value),
     SortByColumns(
     Distinct(Collection, Title),
     "Title",
     SortOrder.Descending
     ),
     Filter(Collection, Title = ComboBox1.Selected.Value)
    )
  • Phineas Profile Picture
    5,331 Moderator on at

    I've implemented your recommendation.

    I don't get an error, but I don't get any ThisItem. options other than 'IsSelected', when I try to assign a column to a field.

    My version of the formula allows me to apply the required columns to the Gallery fields.

    If(IsBlank(ComboBox1.Selected.Value),
        SortByColumns(
       Distinct(Collection, Title),
       "Title",
       SortOrder.Descending
       ),
       Filter(Collection, Title = ComboBox1.Selected.Value))

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard