One day, one of my colleagues asked me if we could filter the Power Apps gallery by the previous five weeks to get all the filtered data. Yes, we can achieve it by using some Power Apps functions like Today(), Weekday(), etc.
In this Power Apps tutorial, I will discuss how to filter Power Apps gallery by week, such as current week, next week, and previous week. Additionally, we will see how to filter the gallery in Power Apps by the next N weeks and previous N weeks with a few examples.
Filter Power Apps Gallery By Week [Current Week]
Here, I will show you how to filter a Power Apps gallery by the current week.
Example:
- I have a SharePoint List named Expense Tracker. This list contains the below fields.
| Column Name | Data Type |
| Item | This is a Title column with a single line of text. I just renamed it to Item |
| Category | Choice |
| Payment Date | Date and time |
| Amount | Number |

- There is a Gallery control in Power Apps. This gallery displays each record from the SharePoint list based on the current week.

- Insert a Gallery control [gal_CurrentWeekExpenses] and set its Items property as:
Items = With(
{
StartDate: Today() - (Weekday(
Today(),
StartOfWeek.Sunday
)) + 1,
EndDate: DateAdd(
Today(),
(7 - Weekday(
Today(),
StartOfWeek.Sunday
)),
TimeUnit.Days
)
},
Filter(
'Expense Tracker',
'Payment Date' >= StartDate,
'Payment Date' <= EndDate
)
)Where,
- StartDate, EndDate = Power Apps Scope Variables
- Today() = Power Apps Today() helps to get the current date
- ‘Expense Tracker’ = SharePoint Online List
- ‘Payment Date’ = SharePoint Date Field

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [This Week’s Records], as in the screenshot below.

This is how to filter a Power Apps gallery by the current week.
Power Apps Filter Gallery By Next Week
Next, we will see how to filter a Power Apps gallery by next week.
Example:
- I will take the same SharePoint list [Expense Tracker] for this example. In Power Apps, there is a Horizontal Gallery control. This gallery displays each record from the SharePoint list based on the following or upcoming week.

To work around this example, follow the below steps. Such as:
- On the Power Apps Screen, insert a Gallery control and set its Items property as:
Items = With(
{
StartDate: Today() - (Weekday(
Today(),
StartOfWeek.Sunday
)) + 7,
EndDate: DateAdd(
Today(),
(7 - Weekday(
Today(),
StartOfWeek.Sunday
))+7,
TimeUnit.Days
)
},
Filter(
'Expense Tracker',
'Payment Date' > StartDate,
'Payment Date' <= EndDate
)
)Where,
- Today() = Power Apps Today() helps to get the current date
- Weekday() = This function returns a number representing the day of the week depending on the start date of the week
- StartOfWeek.Sunday = Start date of the week
- 7 = It is the number of days in a week
- TimeUnit.Days = This time units can evaluate the number of days in a week
Refer to the image below:

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Next Week’s Recors], as shown below.

This is how to filter a Power Apps gallery by the next week.
Power Apps Filter Gallery By Next N Weeks
Let’s see how to filter the Power Apps gallery by the following ‘N’ weeks.
Example:
- I will take the same SharePoint Online list [Expense Tracker] for this example. In Power Apps, there is a Vertical Gallery control. This gallery filters and displays each record from the SharePoint list based on the next/upcoming four weeks.

To do so, follow the below-mentioned steps.
- On the Power Apps Screen, insert a Gallery control and set its Items property to the code below.
Items = With(
{
StartDate: Today(),
EndDate: Today() + (7*4) // You can also change the number of weeks
},
Filter(
'Expense Tracker',
'Payment Date' >= StartDate,
'Payment Date' <= EndDate
)
)Where,
- Today() + (7*4) = Today() function helps to get the current date. 7 is the number of weekdays, and 4 is the next number of weeks.
Refer to the below screenshot:

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Next 4 Week’s Records], as in the screenshot below.

This is all about the Power Apps filter gallery by the next ‘N’ weeks.
Power Apps Filter Gallery By Previous Week
Similarly, here we will see how to filter a Power Apps gallery by the previous week.
Example:
- I will take the same SharePoint list [Expense Tracker] for this example. In Power Apps, there is a Vertical Gallery control. This gallery displays each record from the SharePoint list based on the last or previous week.

To achieve the above example, follow the below steps. Such as:
- On the Power Apps Screen -> Insert a Gallery control and set its Items property as:
Items = With(
{
StartDate: Today()-(Weekday(Today(), StartOfWeek.Sunday))-7,
EndDate: DateAdd(Today(),(7-Weekday(Today(), StartOfWeek.Sunday))-7,TimeUnit.Days)
},
Filter(
'Expense Tracker',
'Payment Date' > StartDate,
'Payment Date' <= EndDate
)
)Where,
- Today(), StartOfWeek.Sunday))-7 = Today () function helps to get the current date. And, -7 is for the last week
Refer to the below image:

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Last Week’s Records], as shown below.

This is how to filter a Power Apps gallery by the previous week.
Power Apps Filter Gallery By Previous ‘N’ Weeks
Finally, I will show you how to filter a Power Apps gallery by previous ‘N’ weeks.
Example:
- I will use the same SharePoint list [Expense Tracker] for this example. Power Apps has a Gallery control. This gallery displays each record from the SharePoint list based on the last two weeks.

To work around this example, follow the below steps.
- On the Power Apps Screen -> Insert a Gallery control and set its Items property code like below.
Items = With(
{
StartDate: Today()- (7*2), // You can also change the number of weeks
EndDate: Today()
},
Filter(
'Expense Tracker',
'Payment Date' > StartDate,
'Payment Date' <= EndDate
)
)Where,
Today()—(7*2) = Today () function helps to get the current date. 7 is the number of weekdays, and 2 is the last number of weeks.

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Last Two Week’s Records], as shown below.

This is how to filter a Power Apps gallery by the last ‘N’ weeks.
Conclusion
I have explained in detail the Power Apps filter gallery by week.
I have also discussed the Power Apps filter gallery by the current week and how to filter a Power Apps gallery by the last week.
In the last, I have covered the Power Apps gallery by the next ‘N’ weeks and how to filter a Power Apps gallery by the previous ‘N’ weeks.
Additionally, you may like some more Power Apps tutorials:
- Filter Power Apps Gallery By Days
- Power Apps Filter Gallery By Date
- Power Apps Filter Gallery By Year
- Power Apps Filter Gallery By Quarter [With Examples]

Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.