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 based on a r...
Power Apps
Answered

Filtering based on a range of number

(0) ShareShare
ReportReport
Posted on by 72

I have a gallery I am using to display recorded incidents.  On the page I have three drop downs: Department, Amount, and Status. These are being used to filter the Gallery. The Gallery is made up of a SQL table that is populated from the app and an excel List. I combined the two with collect and lookup. In the Amount drop down I have 1-5 sticks, 5-10 sticks, 10+ sticks, and All. this was working just fine in the filter below because the table with amount also had the above values for the column, 1-5 Sticks, 5-10, 10+. However, now we are changing the dropdown that populates the SQL table to in lieu of having the ranges it will now allow the user to pick an exact number from 1-100 pieces. So this column will now only have single values in lieu of a range. My question is how do I edit the below formula to filter the gallery based on amount still using the ranges. My goal would to leave in the ranges in the drop down being used for a filter. Then in the filter I have it look between those ranges and determine what rows meet the criteria.

 

When amount between 1-5 = "1-5 Sticks"

 

Filter(TagCollection,
Amount = AmountDropDown.Selected.Amount || AmountDropDown.Selected.Amount = "All",
Status = StatusDropdown.Selected.Status || StatusDropdown.Selected.Status = "-",
SuspectedDept = DepartmentDropDown.Selected.Result || DepartmentDropDown.Selected.Result = "All")

Annotation 2020-09-04 115102.png
Annotation 2020-09-04 115000.png
Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @JmccoyPeerless
    Hello there!


    What I understand is: you have a dropdown (AmountDropdown) having the values All, 1-5 Sticks, 5-10 Sticks, 10+ Sticks.  When you select 1-5 Sticks you want only the records to show having between 1 and 5 sticks.


    Here's my solution.  I assume TagCollection has a column name Amount.

    Filter(
     TagCollection,
     AmountDropDown.Selected.Amount = "All"
     Or AmountDropdown.Selected.Amount = "1-5 Sticks" And Amount >= 1 And Amount <= 5
     Or AmountDropdown.Selected.Amount = "5-10 Sticks" And Amount >= 5 And Amount <= 10
     Or AmountDropdown.Selected.Amount = "10+ Sticks" And Amount > 10,
     Status = StatusDropdown.Selected.Status || StatusDropdown.Selected.Status = "-",
     SuspectedDept = DepartmentDropDown.Selected.Result || DepartmentDropDown.Selected.Result = "All"
    )
    
    
    

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • olasprilla01 Profile Picture
    2 on at

    Please help, I was not able to display lessthan zero for this syntax

    olasprilla01_1-1633336487216.png

     

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard