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 / Filter items beetwen t...
Power Apps
Unanswered

Filter items beetwen two dates

(0) ShareShare
ReportReport
Posted on by 133

Hello , 

I want to filter items in the gallery in power apps to find items created, for example, in one month.

I created two data picker, and I want to choose two dates, and find items between them.

 

I wrote formula in items properties of the gallery:

Filter(
'Instrukcje Tymczasowe',
Created < DatePicker2_1,
Created > DatePicker2_2
)

 

But it doesn't not work. How should I do that ?

Categories:
I have the same question (0)
  • gcmfaizan Profile Picture
    1,022 on at

    @Karolina776 your logic is almost fine you just missing one thing which is = sign here is the right formula:

    Filter(
     'Instrukcje Tymczasowe',
     Created >= DatePicker2_1.SelectedDate,
     Created <= DatePicker2_2.SelectedDate
    )

     

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

  • Chris-D Profile Picture
    1,246 on at

    The answer above is not correct. 

     

    Using an = will slightly modify the criteria but it's not the cause of your issue. The = sign will include the date selected, the > sign on it's own will not. 

    e.g.
    02/09/2023 > 02/09/2023 = false. Records created on 02/09/2023 would not be included. 
    02/09/2023 >= 02/09/2023 = true. Records created on 02/09/2023 would be included. 

     

    The way your formula is written, DatePicker2_1 MUST be the future date, and DatePicker2_2 MUST be the past. Check this is correct? The function looks fine. 

  • Karolina776 Profile Picture
    133 on at

    Thank you, it works but...

    Now I am trying to add it to rest formulas. It looks like that : 

    Search(
    Filter(
    'Instrukcje Tymczasowe',
    IsBlank(Dropdown2_1.Selected.Value) ||
    Status.Value=Dropdown2_1.Selected.Value,
    IsBlank(Dropdown2.Selected.Value) ||
    Dział.Value=Dropdown2.Selected.Value),
    IsBlank(DatePicker2.SelectedDate) ||
    Created >= DatePicker2.SelectedDate,
    IsBlank(DatePicker2_3.SelectedDate) ||
    Created <= DatePicker2_3.SelectedDate
    )
    SearchBox.Text, "Title")

     

    Karolina776_0-1693914876585.png

    Without formulas including date everything worked. Do you have an idea what the problem is ?

  • Chris-D Profile Picture
    1,246 on at

    You're missing a comma after the Filter() statement.

  • Karolina776 Profile Picture
    133 on at

    Like this ?

    Karolina776_0-1693915412638.png

    Still not working 😞

  • Karolina776 Profile Picture
    133 on at

    Formula which was working looks like this: 

    Karolina776_1-1693915614073.png

     

  • gcmfaizan Profile Picture
    1,022 on at

    @Karolina776 can you try this formula there:

    Search(
     Filter(
     'Instrukcje Tymczasowe',
     (IsBlank(Dropdown2_1.Selected.Value) || Status.Value = Dropdown2_1.Selected.Value) &&
     (IsBlank(Dropdown2.Selected.Value) || Dział.Value = Dropdown2.Selected.Value) &&
     (IsBlank(DatePicker2.SelectedDate) || Created >= DatePicker2.SelectedDate) &&
     (IsBlank(DatePicker2_3.SelectedDate) || Created <= DatePicker2_3.SelectedDate)
     ),
     SearchBox.Text,
     "Title"
    )

     

     

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

  • Karolina776 Profile Picture
    133 on at

    I think I got it:

    Karolina776_2-1693915830294.png

     

  • Chris-D Profile Picture
    1,246 on at

    You don't need to use those IsBlank statements. 

     

    IsBlank( Value) || Value = 3
    
    If Value is blank:
    true || Value = 3
    
    What is true? 
    
    If Value is not blank:
    false || Value = 3
    
    What is false? 
    
    The answer to both question is nothing, because it's not related to any column in the data. 

     

    You can simplify by removing the IsBlank() statements. If the fields are blank the Filter just won't return records. 

     

     

  • Karolina776 Profile Picture
    133 on at

    OK, you are right. Thank you.

     

    Do you have any idea how to add to my formula : sort Descending ? 

     

    Search(
    Filter(
    'Instrukcje Tymczasowe',
    IsBlank(Dropdown2_1.Selected.Value) ||
    Status.Value=Dropdown2_1.Selected.Value,
    IsBlank(Dropdown2.Selected.Value) ||
    Dział.Value=Dropdown2.Selected.Value,
    Created >= DatePicker2.SelectedDate,
    Created <= DatePicker2_3.SelectedDate),
    SearchBox.Text, "Title")

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

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard