How to Use Power Apps to Filter a Gallery by Last Week’s Dates

How to Use Power Apps to Filter a Gallery by Last Week’s Dates

Using Power Apps to Display Dates from the Previous Week


Power Apps offers powerful customization features, one of which is the ability to filter data based on specific conditions. In this tutorial, we’ll delve into how you can filter a Power Apps gallery to show only the dates from the past week. For users who manage date-related tasks, this could be a game-changer.

Data Source

We have a SharePoint list titled Calendar Dates which spans from January 1, 2018, to December 31, 2024, encompassing 2,557 entries.

Title CalendarDate
Monday, January 1, 2018 1/1/2018
Tuesday, December 31, 2024 12/31/2024

Implementation Code

        RecentStartDate: Today() - (Weekday(Today(), StartOfWeek.Sunday)) - 7,
        RecentEndDate: DateAdd(Today(), (7 - Weekday(Today(), StartOfWeek.Sunday)) - 7, Days)
        'Calendar Dates',
        CalendarDate > RecentStartDate,
        CalendarDate <= RecentEndDate


  1. With function
  2. Filter functions


Expected Output

When executed, the gallery should display only the dates from the previous week. For example, if today’s date was 6/16/2021, the gallery would show:

Title CalendarDate
Sunday, June 6, 2021 6/6/2021


Some Relevant Insights: 

  • Power Apps Gallery Filter Utility:

    • The primary purpose of the ‘Power Apps Gallery Filter’ is to allow users to sift through specific dates in their dataset.
    • This tool provides a streamlined experience, particularly for professionals who require precision in date selection.
  • Professional Advantage:

    • By employing this filter, professionals can present certain dates in an organized manner, ensuring clarity for both themselves and any stakeholders.
    • It aids in the efficient management of date-driven tasks, such as scheduling, planning, and reporting.
  • Optimization of Tasks and Schedules:

    • The ‘Power Apps Gallery Filter’ is more than just a sorting tool; it’s an optimization resource.
    • It ensures that tasks are aligned with the right dates, preventing scheduling conflicts and ensuring timely task execution.
  • Importance in Large Datasets:

    • Datasets, especially extensive ones like ‘Calendar Dates’, can be overwhelming.
    • The ‘Power Apps Gallery Filter’ becomes crucial in such scenarios, offering a focused view and eliminating unnecessary data.
    • For instance, in the context of SharePoint’s ‘Calendar Dates’, instead of perusing thousands of dates, users can easily narrow down their selection, making data management significantly more manageable.



Power Apps offers robust filtering capabilities, allowing users to streamline data views effectively. This tutorial showcased how you can harness this capability to display dates from the previous week, aiding in date-driven task management.

If you encounter any challenges or need additional technical guidance, please contact us. Our team of experts is always here to assist and ensure you get the most out of Power Apps.

About The Author