Live Developer Training: next batch coming soon. Be the first to know.Live training: next batch soonJoin the waitlist →Join →

Power Apps Filter Gallery By Date [With Examples]

This Power Apps tutorial will help you to learn how to work with Power Apps Filter Gallery By Date with various examples.

Also, we will discuss how to filter Power Apps gallery by Date range, how to filter Power Apps gallery by today’s date, and many more like:

  • Filter Power Apps Gallery if the Date is today or greater than today’s date
  • Filter Power Apps Gallery By Today Or Yesterday

Check out: Power Apps Gallery Control Examples Download [20 Various Real Scenarios]

Set up a SharePoint List

I have used a SharePoint list Job Seekers Registration List for all the above examples. This list has these many columns (with different data types):

ColumnsData types
First NameSingle line of text (This is a Title column, I just renamed it to First Name)
SurnameSingle line of text
Registration IDNumber
Apply DateDate and time

Also, this list has some records, as shown in the below screenshot.

Power Apps Gallery Filter by Dates

Power Apps Filter Gallery by Date

In this example, we will see how to work with the Power Apps filter gallery by date.

  • The screenshot below represents a Power Apps Date picker and Gallery control. When a user selects any date from the date picker, the gallery will filter and display the records based on the selected date. All the gallery data will come from the SharePoint list [Job Seekers Registration List].
  • For example, when I selected the date as “8/8/2023“, the gallery filtered and displayed all the records of that specific date.
Power Apps filter gallery by date
  • To work around this, select the gallery control and apply the code below on its Items property as:
Items = Filter(
    'Job Seekers Registration List',
    Text(
        'Apply Date',
        DateTimeFormat.ShortDate
    ) = Text(
        dtApplyDate.SelectedDate,
        DateTimeFormat.ShortDate
    )
)

Where,

  1. ‘Apply Date’ = SharePoint Date column
  2. dtApplyDate = Date picker control name
Power Apps Gallery Filter by date

This is how we can filter the Power Apps gallery by date value.

Power Apps Filter Gallery by Date Range

Here we will see how to work with Power Apps Filter Gallery by Date Range.

  • The below image represents two Power Apps Date picker controls (Select Start Date & Select End Date) and a Gallery control. When a user selects a specific start date and end date, the gallery will filter and display all the records within the selected date range.
  • For example, when I selected the Start Date as “8/5/2023” and End Date as “8/8/2023“, the gallery filtered and displayed the records within the selected 5-8 date range.
Power Apps Filter Gallery by Date Range
  • To achieve this, select the gallery and apply the code below on its Items property as:
Items = Filter(
    'Job Seekers Registration List',
    'Apply Date' >= dtStartDate.SelectedDate,
    'Apply Date' <= dtEndDate.SelectedDate
)

OR

Items = Filter(
    'Job Seekers Registration List',
    ('Apply Date' >= dtStartDate.SelectedDate) && ('Apply Date' <= dtEndDate.SelectedDate)
)

We can use any of the above formulas.

Where,

  1. ‘Job Seekers Registration List’ = SharePoint List Name
  2. ‘Apply Date’ = SharePoint Date Column
  3. dtStartDate = Date picker control name of the Start Date
  4. dtEndDate = Date picker control name of the End Date
PowerApps Gallery Filter by Date Range

This is how to Filter Power Apps Gallery by Date Range.

Power Apps Filter Gallery by Today’s Date

This section will use various scenarios to show how to work with Power Apps Filter Gallery by Today’s Date.

Example – 1: [Filter Power Apps Gallery by Today]

  • The figure below represents a Power Apps gallery that displays all the records based on Today’s Date, i.e., 8/17/2023.
Power Apps Filter Gallery by Today's Date
  • To do so, select the gallery control and set its Items property to the below formula:
Items = Filter(
    'Job Seekers Registration List',
    'Apply Date' >= Today(),
    'Apply Date' < DateAdd(
        Today(),
        1,
        TimeUnit.Days
    )
)

OR

Items = With(
    {
        StartDate: Today(),
        EndDate: Today() + 1
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= StartDate,
        'Apply Date' < EndDate
    )
)

We can use any of the above formulas.

Where,

  1. ‘Job Seekers Registration List‘ = SharePoint List Name
  2. ‘Apply Date‘ = SharePoint Date Column
  3. StartDate, EndDate = Scope variable names