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 a Gallery us...
Power Apps
Answered

Filtering a Gallery using two date fields from a SharePoint list

(0) ShareShare
ReportReport
Posted on by

Hi,

I hope you can help me out here:

 

Scenario:

 

I have a SharePoint list with two columns,  "Start Date" and "End Date".  In PowerApps I have a simple Gallery that I want to filter, the filter will show all items in the list that fall between two dates in the above columns, the date range is 1/4/19 -> 31/3/20.  I've had a good troll through these forums and there is a lot about this but using date pickers, as the date is already in the list I've got stuck.

 

The basic formula I am trying to use is:

 

Filter(COLLECTION, 'Start Date' >= "1/4/2019" And 'End Date' <= "31/3/2020")


But that causes all sorts of red wigglies.

 

I am sure this should be possible but my brain is really hurting now, hence the call for help.

 

Thanks

Rob

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    Try this code...

    Filter(COLLECTION, 'Start Date' >= Date(2019,1,4) And 'End Date' <= Date(2020,3,31))

     

    ---
    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."

    @Rob_CTL 

  • Rob_CTL Profile Picture
    on at

    EDIT: Ignore the reply below, it was a user input error on my part, pesky typos!  Thanks for the help @mdevaney 

     

    @mdevaney thanks for the help, that's almost there but for some reason it is showing dates outside of the specified range, i.e. if I create an item with a start/end date of 20/3/2019 it will be displayed even though this is before 1/4/2019.  I've tried changing the format i.e. 2019,1,4 and 1,4,2019 but this either gives even more items or none at all.  Would it matter that I am showing the dates within the gallery in a Label control with the following formatting applied

     

     

    Text(ThisItem.'Start Date',"[$-en]dd/mm/yyyy")

     

     

    Thanks
    Rob 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 528

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard