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 / Filter combobox results
Power Apps
Unanswered

Filter combobox results

(0) ShareShare
ReportReport
Posted on by 254

I have a gallery which shows results from a collection (colMyCollection).  I have multiple comboboxes above the gallery for filtering the gallery.  In my Department Combobox I am using the following function in Items property:-

Sort(ForAll(Distinct(colMyCollection,Department), {Result: ThisRecord.Value}),Result)

 

I now want to show a second combobox that shows only the distinct disciplines from colMyCollection that have the same department as selected in the Department combobox.

 

If no Department is selected I'd like my discipline combobox to show all distinct disciplines, if a department is selected from the first combobox I'd like my Discipline combox to only show disciplines that have the same department.

 

I'm sure this is simple to do but I've been away from PowerApps for a while and can't figure this out.

Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,664 on at

    If(IsBlank(DepartmentComboBox.Selected.Value), Distinct(colMyCollection, Discipline), Distinct(Filter(colMyCollection, Department = DepartmentComboBox.Selected.Value), Discipline) )

     

    Please click Accept as solution and give it Thumbs Up if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • SteveSmith81 Profile Picture
    11 on at

    Firstly, I think you might be overcomplicating your Department combobox.
    Unless I'm missing something (which is entirely possible), you could use something like this...
    Sort(Distinct(colMyCollection,Department),Value)

    On your main question, you can use @developerAJ's formula above, or this would also work.

    Distinct(
    Filter(
    colMyCollection,
    Department = cboDeptFilter.Selected.Value || IsBlank(cboDeptFilter.Selected.Value)
    ),
    Discipline
    )


    I'm not sure if there is any advantage of one over the other.

    Both @developerAJ's answer and mine are assuming your department combo box isn't multi-select. If you're allowing multi-select you'll need to adapt the formulas to use SelectedItems rather than Selected.

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard