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 / How to make a Filter i...
Power Apps
Answered

How to make a Filter in a Gallery on Date of Birth

(0) ShareShare
ReportReport
Posted on by 1,066

Dear Community,

 

I have a gallery on my form which is connected to a Sharepoint List. In the Sharepoint List is a column called "Geboortedatum" (which means Date of Birth) where the date of birth of everyone is stored. Is it possible to make a query in PowerApps that get's all the records from the persons which Date of Birth is today. Like you can do in Sharepoint list also:

 

PeKi72_0-1692724750575.png

Is this possible in PowerApps to create a button and by pressing on it to get all the records which "Geboortedatum" = "Vandaag" (means Today)

 

I do not get further than this: Filter('Employee Directory';'Geboortedatum '.....

Gr. P

 

Categories:
  • rpersad Profile Picture
    831 on at

    In your gallery Items property enter this code:

    Filter('Database Name', DateDiff('Date Column name', 'Date Picker'.SelectedDate || 'Date Picker'.SelectedDate = Blank())

     If you want to use a button to check all date of births that are today in the OnSelect property of the button set a variable to today's date.

    Set(Vandaag, Today())

     

    And replace 'Date Picker'.SelectedDate with the variable "Vandaag".

  • Prabhakar_S Profile Picture
    735 Moderator on at

    Hi @PeKi72 ,

     

    You can put this formula in the Onselect Property of the Button and Set the Gallery Items to TodaysBirthdays and insert a label and give the Text property as "Thisitem.Name" when you click on the button it shows the Names of Todays Birthday date,

     

    Set(Vandaag, Today());
    ClearCollect(
    TodaysBirthdays,
    Filter(
    DataSource, // Replace with the actual name of your SharePoint list
    DateValue(Geboortedatum) = Vandaag
    )
    )

      

    Thanks!!!

     

    If my response has been helpful in resolving your issue, I would suggest you consider clicking "Accept as solution" and "Give it a thumbs up" as a token of appreciation.
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PeKi72,

     

    Should you already be using a gallery and you only want to filter on Geboortedatum after the button is pressed, you could try the following:

     

    //OnSelect of you Button
    Set(varFilterByDate, true)
    
    //Items property of the Gallery
    Filter(
     'Employee Directory';
     //Or the button hasn't been pressed and we display all records, or filter by date of birth
     varFilterByDate = false || Geboortedatum = Today()
    )

    In this case make sure that Geboortedatum does not have 'Time' enabled in the column settings.

     

    OnHidden of the screen would reset the variable to false:

    //OnHidden
    Set(varFilterByDate, true)

     

    Alternatively you could use a Toggle to allow the user to switch between the Filter and full view:

    Filter(
     'Employee Directory';
     //Will only filter by date of birth when the Toggle is on
     ToggleName.Value || Geboortedatum = Today()
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • CU16021406-1 Profile Picture
    1,066 on at

    I go for the toggle from LaurensM. 

    I only have a question about the toggle. Do i need the variable? 

    After testing it when i put it to ON i get All the records when i put the

    toggle of i get only the records of the birthdays.

     

    Gr.P

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PeKi72,

     

    You won't need the variable since we will use the toggle value directly. I forgot 1 slight adjustment, place an exclamation mark before the ToggleName.Value:

    Filter(
     'Employee Directory';
     //Will only filter by date of birth when the Toggle is on
     !ToggleName.Value || Geboortedatum = Today()
    )

    Now it will function the way I defined it in the comment above. 😁

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • CU16021406-1 Profile Picture
    1,066 on at

    Thanks 🙂

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard