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.

See also  How to Increment Number in Power Apps Gallery?

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.

See also  PowerApps LastSubmit() with Examples

Where,

  1. Job Seekers Registration List‘ = SharePoint List Name
  2. Apply Date‘ = SharePoint Date Column
  3. StartDate, EndDate = Scope variable names
Power Apps Filter Gallery by Today

This is how to filter the Power Apps gallery by today’s date.

Example – 2: [Filter Power Apps Gallery if Date is today or greater than today’s date]

  • Next, we will see how to filter Power Apps Gallery if Date is today or greater than today’s date. As today’s date is 8/17/2023, the gallery below displays all the current and future records, i.e., 8/18/2023.
Filter Power Apps Gallery by Today
  • To work with this, apply the code below on the gallery’s Items property:
Items = Filter(
    'Job Seekers Registration List',
    'Apply Date' >= Today()
)

Where,

Apply Date‘ = SharePoint Date Column

PowerApps Filter Gallery by Today's Date

This is all about Filter Power Apps Gallery if Date is today or greater than today.

Example – 3: [Filter Power Apps Gallery By Today Or Yesterday]

  • Similarly, if a user wants to filter the Power Apps gallery by today or yesterday’s date, this scenario will help.
  • As today’s date is 8/17/2023, the gallery below displays all the current and yesterday’s records, i.e., 8/16/2023.
Filter Power Apps Gallery By Today Or Yesterday
  • To achieve this, write the below code on the gallery’s Items property:
Items = Filter(
    'Job Seekers Registration List',
    (Text(
        'Apply Date',
        DateTimeFormat.ShortDate
    ) = Text(
        Today(),
        DateTimeFormat.ShortDate
    ) || Text(
        DateAdd(
            Today(),
            -1,
            TimeUnit.Days
        ),
        DateTimeFormat.ShortDate
    ) = Text(
        'Apply Date',
        DateTimeFormat.ShortDate
    ))
)

Refer to the image below.

Power Apps Filter Gallery By Today Or Yesterday

This is all about Filter Power Apps Gallery By Today Or Yesterday.

Additionally, you may like some more Power Apps tutorials:

See also  PowerApps Functions Tutorial

In this Power Apps tutorial, we discussed how to filter Power Apps gallery by date, and how to filter Power Apps gallery by date range with different examples.

Moreover, we learned some more below topics as well:

  • Power Apps filter gallery by today’s date
    • Filter Power Apps Gallery if Date is today or greater than today’s date
    • Filter Power Apps Gallery By Today Or Yesterday
>