Power BI DAX YEAR function

The Power BI YEAR function is one of the DAX Date and Time functions useful to return the year as a four-digit number ranging from 1900 to 9999 from the given Date. This article explains the YEAR function that accepts the date value and returns an integer from 1900 to 9999 as Gregorian values and the syntax is shown below:

YEAR(<date>)

The POWER BI DAX YEAR function takes the date value from the given column or text representation of the date as an argument and extracts the year from it. 

  • The argument can be a date, datetime, or the expression that returns or is implicitly convertible to the datetime or date. 
  • When the date argument is the text representation, the YEAR function uses the current local date and time settings to understand a text value. If it can’t convert correctly, the YEAR function returns an error.

Power BI DAX YEAR function Example

To demonstrate the DAX YEAR() function, go to the Modeling Tab, click the New Column button, and rename it as Year. The below expression uses the Order Date column from the SuperStore Orders table to print the Year value (1900 – 9999) from the Order date.

Next, please add the new Year column to the table report. Please refer to the DateTime and the function article for the remaining Power BI methods. For more Charts >> Click Here.

YEAR = YEAR(Orders[Order Date])

You can try the below expression and it returns the same result.

YEARs = Orders[Order Date].[YEAR]
YEAR Function 1

You can create three line charts to show the Year wise sales, orders, and profit. Otherwise, create a Stacked Column Chart with X-Axis YEAR, Y-Axis Profit, and Legend Sub-Category. Click any part of the Stacked Column Chart to see or highlight the YEAR results in a particular Subcategory.

POWER BI DAX YEAR Function 2