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 / Dynamic filter on coll...
Power Apps
Answered

Dynamic filter on collection with multiselect combobox and number range

(0) ShareShare
ReportReport
Posted on by 4

So I have a collection collData and a column Sales (datatype Num). I have a combobox(cmboSales) where I have the Sales value in range format and the items of the combo box are as follows

 

["1-100", "100-200", "200-300"]

 

I have implemented a filter on the collection,collData, based on the combobox(cmboSales) as follows

 

Filter(collData, cmboSales.Selected.Value = "1-100"&& Sales>=1&&Sales<100 Or
cmboSales.Selected.Value = "100-200"&& Sales>=100&&Sales<200
Or
cmboSales.Selected.Value = "200-300"&& Sales>=200&&Sales<300) 

 

 Now this is done with multiselect set to false.

 

How do I make this work with multiselect set to true. I cannot for the life of me figure out how to create a dynamic filter here. I am able to get the filter string by using Concatenate but as it returns a string the filter function is not taking it.

Categories:
I have the same question (0)
  • Verified answer
    R3dKap Profile Picture
    1,594 on at

    Hi @anon_121212,

    First of all, just a little suggestion: use parenthesis to separate the different parts of your Filter() conditions since they combine AND and OR conditions. Something like this (always easier to read as well):

    Filter(
     collData, (cmboSales.Selected.Value = "1-100" && Sales >= 1 && Sales < 100) Or (cmboSales.Selected.Value = "100-200" && Sales >= 100 && Sales < 200) Or (cmboSales.Selected.Value = "200-300" && Sales >= 200 && Sales < 300)
    ) 

    To answer your questions, try something like this if your combo box is multiselected:

    Filter(
     collData, ("1-100" in cmboSales.SelectedItems && Sales >= 1 && Sales < 100) Or ("100-200" in cmboSales.SelectedItems && Sales >= 100 && Sales < 200) Or ("200-300" in cmboSales.SelectedItems && Sales >= 200 && Sales < 300)
    ) 

    Tell us if this works...

  • anon_121212 Profile Picture
    4 on at

    Thank you so much. This is exactly what I was looking for and it worked like a charm.

  • R3dKap Profile Picture
    1,594 on at

    Glad I could help... 🙂

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 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard