web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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

What am I doing wrong in the below formula.

I have a ComboBox and a Gallery.

Goal:
If the ComboBox is empty distinct filter the Collection by Title, where each member only appears once.

Else filter the Collection for all items associated with name chosen in ComboBox.

The second half - alone, works, but I can't get the initial distinct to work.

The 'Title' column contains the member's full name (Doyle, Popeye), called FullName in SP List view.

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

Categories:
I have the same question (0)
  • charlessexton Profile Picture
    19 Super User 2024 Season 1 on at

    Distinct() returns a one-column table, so if you're expecting a 'FullName' column that won't be there. It will only be returning 'Value'.

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-distinct

  • Phineas Profile Picture
    5,331 Moderator on at

    I'm expecting the Title column content (the member's full name) - and all associated content on that item row in the SP List, to appear in the gallery once - the first instance of the member's name is sufficient.

    This is possible as a distinct of sort function, yes?

    Current View:
    (Title/FullName)
    Doyle, Popeye      Sailor
    Doyle, Popeye      Sailor
    Doyle, Popeye      Sailor
    Doyle, Popeye      Sailor
    Bunny, Bugs        Carrot Thief
    Bunny, Bugs        Carrot Thief
    Bunny, Bugs        Carrot Thief
    Wayne, Bruce      Philanthropist
    Wayne, Bruce      Philanthropist

    Goal:
    Doyle, Popeye      Sailor
    Bunny, Bugs        Carrot Thief
    Wayne, Bruce      Philanthropist

  • charlessexton Profile Picture
    19 Super User 2024 Season 1 on at

    You can use GroupBy() to achieve what you want. Please see attached.

    Screenshot 2023-06-13 170723.png
  • charlessexton Profile Picture
    19 Super User 2024 Season 1 on at

    You can use GroupBy() to achieve what you want. Please see attached.

     

    So you would just choose the columns you need. I put "Role" for the things like Sailor, Carrot Thief.

    GroupBy(Collection, "Title", "Role", "Group")

     

    Screenshot 2023-06-13 170723.png
  • Phineas Profile Picture
    5,331 Moderator on at

    Thank you.

    Is there a limit on the number or type of columns you can group?

    The GroupBy portion works for half the columns.

    Once I try to add "Created" (SP system default date column), "Pay_Type" (single line to text), or "Pay_Hours" (Number), for example, the member's name then appears multiple times (though not all instances of the member's name appears.

    Example: one member appears on the list 12 times with a regular filter of the collection.
    Before entering any of the above columns, and with the first five columns loaded into the GroupBy formula the member's name only appears once - as desired.

    Once I enter any of the above columns the member's names start to appear multiple times (four times in this example) , rather than just the once time desired.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 291 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 282 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard