This Microsoft Power Apps tutorial explains everything about the Power Apps filter gallery by year.
Here, I will discuss how to filter a Power Apps gallery by the current year and how to filter a Power Apps gallery by next year.
Moreover, we will see the topics below:
- Filter Power Apps gallery by next ‘N’ years
- Filter Power Apps gallery by Previous year
- How to filter a Power Apps gallery by previous ‘N’ years
Power Apps Filter Gallery By Year [Current Year]
I will show you how to filter a Power Apps gallery by the current year.
Example:
- I have a SharePoint Online List named “Travel Requests“. This list contains the below fields.
Column Name | Data Type |
Trip Title | This is a Title column with a single line of text. I just renamed it to “Trip Title” |
Destination | Choice |
Travel Start Date | Date and time |
Travel End Date | Date and time |

- In Power Apps, there is a Gallery control. This gallery displays each record from the SharePoint list based on the current Year.

To achieve the above example, follow the below steps. Such as:
- Open Power Apps -> Create Power Apps canvas app -> Connect the SharePoint list, i.e., [Travel Requests] to the app. Once you connect, it will look like the screenshot below.

- Insert a Gallery control [gal_CurrentYearTrips] and set its Items property to the code below.
Items = With(
{
StartDate: Date(
Year(Today()),
1,
1
),
EndDate: Date(
Year(Today()),
12,
31
)
},
Filter(
'Travel Requests',
'Travel Start Date' >= StartDate,
'Travel End Date' <= EndDate
)
)
Where,
- With() = This function can help us to evaluate a formula for a single record
- StartDate, EndDate = Power Apps Scope Variables
- Date() = This function used to convert individual Year, Month, and Day values to a Date/Time value
- Year() = This function returns the year component of a Date/Time value
- Today() = Power Apps Today() helps to get the current date
- ’12’, ’31‘ = 12 for the number of months and 31 for the number of days in a month
- ‘Travel Requests’ = SharePoint Online List
- ‘Travel Start Date’, ‘Travel End Date’ = SharePoint date fields columns

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

This is how to filter a Power Apps gallery by the current year.
Power Apps Filter Gallery By Next Year
Next, we will see how to filter a Power Apps gallery by next year.
Example:
- I will also take the same SharePoint Online list [Travel Requests] for this example.
- In Power Apps, there is a Horizontal Gallery control. This gallery displays each record from the SharePoint list based on the next or upcoming year.
Refer to the below image:

To work around this example, follow the below-mentioned steps. Such as:
- On the Power Apps Screen -> Insert a Gallery control and set its Items property as:
Items = With(
{
StartDate: Date(
Year(Today())+1,
1,
1
),
EndDate: Date(
Year(Today())+1,
12,
31
)
},
Filter(
'Travel Requests',
'Travel Start Date' >= StartDate,
'Travel End Date' <= EndDate
)
)
Where,
- Year(Today())+1 = This function returns the year component of a Date/Time value and ‘1’ is used for the next year

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Next Year Records], shown below.

This is how to filter a Power Apps gallery by next/upcoming year.
Power Apps Filter Gallery By Next ‘N’ Years
Let’s see how to filter the Power Apps gallery by the next ‘N’ Years.
Example:
- I will take the same SharePoint Online list [Travel Requests] 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 two years.

To do so, follow the below steps.
- On the Power Apps Screen -> Insert a Gallery control and set its Items property to the code below.
Items = With(
{
StartDate: Date(
Year(Today()),
Month(Today()),
Day(Today())
),
EndDate: Date(
Year(Today()) + 2,
Month(Today()),
Day(Today())
) - 1
},
Filter(
'Travel Requests',
'Travel Start Date' >= StartDate,
'Travel End Date' <= EndDate
)
)
Where,
- Year(Today()) = This function returns the year component of a Date/Time value
- Month(Today()) = This function returns the month component of a Date/Time value
- Year(Today()) + 2 = 2 is number of next years // You can change No of years
Refer to the below screenshot:

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Next 2 years records] like below.

This is all about how to filter a Power Apps gallery by the next/upcoming years.
Power Apps Filter Gallery By Last Year
Similarly, here we will see how to filter a Power Apps gallery by the previous year.
Example:
- I will take the same SharePoint Online list [Travel Requests] 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 year.

To achieve it, follow the below-mentioned steps. Such as:
- On the Power Apps Screen -> Insert a Gallery control and set its Items property as:
Items = With(
{
StartDate: Date(
Year(Today())-1,
1,
1
),
EndDate: Date(
Year(Today())-1,
12,
31
)
},
Filter(
'Travel Requests',
'Travel Start Date' >= StartDate,
'Travel End Date' <= EndDate
)
)
Where,
- Year(Today())-1 = This function returns the year component of a Date/Time value and ‘1’ is used for the previous/last year
Refer to the below image:

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

This is how to filter a Power Apps gallery by last year.
Power Apps Filter Gallery By Previous ‘N’ Years
Finally, I will show you how to filter a Power Apps gallery by previous ‘N’ years.
Example:
- I will also take the same SharePoint Online list [Travel Requests] for this example.
- In Power Apps, there is a Gallery control. This gallery displays each record from the SharePoint list based on the last/previous four years.

To work around the above 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: Date(
Year(Today())-4,
Month(Today()),
Day(Today())
)+ 1,
EndDate: Date(
Year(Today()),
Month(Today()),
Day(Today())
)
},
Filter(
'Travel Requests',
'Travel Start Date' >= StartDate,
'Travel End Date' <= EndDate
)
)
Where,
- Year(Today())-4 = This function returns the year component of a Date/Time value, and 4 is the number of previous years // You can change the number of years
Refer to the below screenshot:

- Save, Publish, and Preview the app. The gallery will display the filtered records, i.e., [Last Four Years Records]

This is all about the Power Apps filter gallery by previous/last ‘N’ years.
Also, you may like some more Power Apps tutorials:
- Power Apps Filter Gallery By Days
- Power Apps Filter Gallery By Week
- Power Apps Filter Gallery By Date
- Power Apps Filter Gallery By Quarter [With Examples]
- How to Filter Power Apps Gallery by Person
Conclusion
This Microsoft Power Apps tutorial taught us all about the Power Apps filter gallery by year.
Here, I explained how to filter the Power Apps gallery by the current year and how to filter the Power Apps gallery by next year.
Also, we discussed the Power Apps filter gallery by the next/upcoming ‘N’ years and how to filter a Power Apps gallery by the previous year. Last, we covered how to filter a Power Apps gallery by previous ‘N’ years.

Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.