Power Apps Year() Function + Examples

Power Apps Year Function allows users to manipulate dates and times within Power Apps applications.

This function allows users to perform various operations, such as extracting the year from a date, calculating the difference in years between two dates, or even filtering data based on specific years.

In this Power Apps tutorial, I will show you all about Power Apps Year() Function, its syntax, and some examples like:

  1. Power Apps current year
  2. Display year based on date in Power Apps
  3. Power Apps extract the year from date-picker
  4. Power Apps year dropdown
  5. Power Apps year difference between two dates

Power Apps Year() Function

Power Apps Year() Function allows users to extract the year from a specified date value starting from 1900.

Below is the syntax for the Power Apps Year function:

Year( DateTime )

How to Get Current Year in Power Apps

Let’s see how to work with Power Apps current year.

  • On the Power Apps screen, insert a Text label and set its Text property as:
Year(Today())                   
Power Apps Current Year
  • Now, we can see that the text label is displaying the current year [2024] as shown below:
Display current year in Power Apps

This is how we can display the current year in Power Apps.

How to Display Year Based On Date in Power Apps

Let me show you how to display the year based on a particular date in Power Apps.

  • Insert a Text label and set its Text property:
Year(DateValue("March 10th 2026")) 

March 10th 2026” = Specify the date

Power Apps Year Based on a Date
  • Now, the text label is displaying the year of the specified given date as shown below:
Display year based on date in Power Apps

This is how to display the Power Apps year based on a particular date.

How to Extract the Year From Power Apps Date Picker

Let’s check how to extract the year from the Power Apps Date picker control.

Example:

I have added a Date picker control and a Text label in Power Apps. Whenever the user selects a particular date from the date picker, the label will display the particular year from the selected date.

Power Apps Extract the Year from Date-Picker

To achieve it, follow the below steps:

  • On the Power Apps screen, insert a Date-picker control as shown below:
Year Function in Power Apps
  • Add a Text label control and set its Text property as:
Text("Project Started in: " & Year(dte_ProjectStartDate.SelectedDate))

Where,

  1. dte_ProjectStartDate = Date picker control name
Extract the Year from Date-Picker in Power Apps
  • SavePublish, and Preview the app. When the user selects a date from the date picker, the text label will display the particular year from the specific date.
How to use a Power Apps Year function

This way, we can extract the year from Date Picker in Power Apps.

Power Apps Year Dropdown

This section will show how to add years in a Power Apps Dropdown control.

Example:

As you can see below, I need to add the last two years, the current year, and the next two years to the Power Apps dropdown menu:

To achieve it, follow the below steps:

  • On the Power Apps screen, insert a Dropdown control -> Set its Items property to:
[
    Year(Today())-2,
    Year(Today())-1,
    Year(Today()),
    Year(Today())+1,
    Year(Today())+2,
]
Power Apps Populate Dropdown with Years
  • Once the app is ready, SavePublish, and Preview it. The dropdown now includes values for the past two years, the current year, and the following two years.
How to populate dropdown with years in Power Apps

This is how to add years in a Power Apps Dropdown control.

Power Apps Year Difference Between Two Dates

Here, you will learn to check the year difference between two dates in Power Apps.

Example:

I have a SharePoint list [ACGH Employee] with various columns like:

Column NameData type
Employee NameTitle
Employee DepartmentChoice [“HR,” “Marketing,” “IT,” “Finance”]
Employee Start DateDate and time
Employee End DateDate and time
Years CompletedNumber
Power Apps year difference between two dates

I have added an Edit form connected to the above SharePoint list on the Power Apps screen. The form contains the two date-picker controls [‘Employee Start Date’ and ‘Employee End Date’] and one text-input control [Years Completed]

When the user enters both dates, the text input should show the number of years between the selected dates.

Year difference between two dates in Power Apps

Follow the below steps to achieve this:

  • On the Power Apps Edit form, select the Text-input control -> Set its Text property to:
DateDiff(
    dte_EmployeeStartDate.SelectedDate,
    dte_EmployeeEndDate.SelectedDate,
    TimeUnit.Years
)

Where,

  1. dte_EmployeeStartDate = Date-picker control name [Employee Start Date]
  2. dte_EmployeeEndDate = Date-picker control name [Employee End Date]
Calculate year difference between two date in Power Apps
  • Once the app is ready, SavePublish, and Preview the app. Whenever the user selects a date from both date-picker controls, the text input will display the number of years between the selected dates.
How to calculate year difference between two date in Power Apps

Conclusion

Power Apps provides a convenient way to work with dates and times through the Power Apps Year() Function.

This Power Apps tutorial helped you to understand the Year Function in Power Apps, its syntax, and different scenarios like getting Power Apps current year, displaying the year based on the date in Power Apps, and many more.

Additionally, you may also like some more Power Apps tutorials: