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 / Filtering using with o...
Power Apps
Answered

Filtering using with one or more values

(0) ShareShare
ReportReport
Posted on by 48

Hello,

I would like to ask for advice on creating an application. I have this gallery filter bound to ComboBoxes. The problem starts when I try to apply a filter to only one of the ComboBoxes. At such a moment, the filter does not work, as if it is waiting for the second one to fill.

Please advise how to solve this problem.

My code is this:

 

Sort(Filter('Hardware Catalogs';'Item Group' in ComboBox2.SelectedItems And 'Vendor' in ComboBox3.SelectedItems);'Created On';SortOrder.Descending)

 

 


THANK YOU FOR ANY ADVICE!

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at
    Sort(Filter('Hardware Catalogs';'Item Group' in ComboBox2.SelectedItems Or 'Vendor' in ComboBox3.SelectedItems);'Created On';SortOrder.Descending)
  • Joel-Garrison Profile Picture
    63 on at

    Howdy Zeslonatrus,

    Can you double check your Syntax for us please?

    Looks like you're using close ```;``` in places that it doesn't work. I believe you might want to try using ``` , ``` instead. Now this might have just been a weird Copy and Paste into the Forum.

    Sort(
     Filter(
     'Hardware Catalogs', 
     'Item Group' in ComboBox2.SelectedItems,
     'Vendor' in ComboBox3.SelectedItems);
     'Created On',
     SortOrder.Descending
     );



    Sort and SortByColumns functions in Power Apps - Power Platform | Microsoft Learn
    Filter, Search, and LookUp functions in Power Apps (contains video) - Power Platform | Microsoft Learn

  • Zeslonatrus Profile Picture
    48 on at

    Thank you for your response!

    But the "Or" function doesn't suit me, because I would like to get a filter that conditions in both cases of the choice. When I use the "Or" function, the result shows more data than I need. I would only like to achieve that when I have only one option filled in, the filter works.

  • Zeslonatrus Profile Picture
    48 on at

    Thank you, but ";" is fine, i think this is just because im from Europe

  • Joel-Garrison Profile Picture
    63 on at

    I'll defer to you on European Syntax 🙂

    However, still take a look at my syntax below. Make sure you're using the correct Filter Syntax using the seperator between your Formulas:

    IE: Filter(Table*, Formula1 [, *Formula2*, ... ] )

    Sort(
     Filter(
     'Hardware Catalogs', //Table
     'Item Group' in ComboBox2.SelectedItems, //Formula1
     'Vendor' in ComboBox3.SelectedItems); //Formula2 with Filter Close Par
     'Created On',
     SortOrder.Descending
     );

     

  • Zeslonatrus Profile Picture
    48 on at

    I dont know if we understand each other well, sorry, english is not my main language. 

    My code woks well for me! But only when i use both of ComboBoxes. If i want use JUST ComboBox2, or JUST ComboBox3, Gallery doesnt show anything. It wait util I fill both of them. And i want make this ComboBoxes work without each other and with each other if you understand 🙂  I was trying your code but its not work and want me make from "," ";".

    Thank you for you replies!

  • madlad Profile Picture
    2,637 Moderator on at

    You could use something along the lines of:

    Sort(Filter('Hardware Catalogs'; If(!IsEmpty(ComboBox2.SelectedItems) And !IsEmpty(ComboBox3.SelectedItems); 'Item Group' in ComboBox2.SelectedItems And 'Vendor' in ComboBox3.SelectedItems; !IsEmpty(ComboBox3.SelectedItems); 'Vendor' in ComboBox3.SelectedItems; !IsEmpty(ComboBox2.SelectedItems); 'Item Group' in ComboBox2.SelectedItems);'Created On';SortOrder.Descending)

     

    which will check if they're both selected, use both, and if only 1 is selected, use that one. I'm not sure my syntax is 100% correct since you're in a different region than me but thats the general idea behind it

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Zeslonatrus 

    I think this is what you might be looking for:

    Sort(
     Filter('Hardware Catalogs';
     ('Item Group' in ComboBox2.SelectedItems Or IsEmpty(ComboBox2.SelectedItems))And 
     ('Vendor' in ComboBox3.SelectedItems Or IsEmpty(ComboBox3.SelectedItems))
     );
     'Created On';
     SortOrder.Descending
    )
  • Zeslonatrus Profile Picture
    48 on at

    Thank you very much!!

  • Joel-Garrison Profile Picture
    63 on at

    Yep, Zeslonatrus was correct I was missing the Or in his post. 🙂 Thanks for catching that and getting the answers out! Awesome!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard