Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Power Apps Gallery Filtering Issue with Year

(1) ShareShare
ReportReport
Posted on by 8
I want to filter a gallery based on year values from a SharePoint list. The SharePoint list has a calculated column called ProjectStart_Year that extracts and stores the year as a Date/Time (e.g., "2023"). I want to allow users to filter the gallery using a search bar (which already works as my code shows) and the year using a dropdown.
 
I intend to use a dropdown to show the distinct years which the gallery should filter by

Code:
If(
    IsBlank(SearchBar.Text),
    'Data Source',  
    Filter('Data Source', StartsWith(Title, SearchBar.Text))
)
It's kind of tricky because I think the SP list column contains date and time by default and PowerApps can match the date when looking up a record but not a time.
If somebody could help me with the coding of the Gallery items property code I would appreciate it.
 
Also, off topic question, For some reason, The forum's UI changed and I don't have the option to reply to responses. is that a bug?
  • Suggested answer
    WarrenBelz Profile Picture
    148,811 Most Valuable Professional on at
    Power Apps Gallery Filtering Issue with Year
    Unfortunately SharePoint calculated columns, apart from not supporting Delegation, do not "play well" with Power Apps and should not be relied on for queries.
    Firstly, set the Default of SearchBar to "" (empty string) and then using your reference date and the field in the list that the calculated column references.
    With(
       {
          _Start: Date(Year(YourReferenceDate), 1, 1),
          _End: Date(Year(YourReferenceDate), 12, 31)
       },
       Filter(
          'Data Source', 
          StartsWith(
             Title, 
             SearchBar.Text
          ) &&
          YourDateField >=_Start && YourDateField <= _End
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1