How can you extract the year from a date using Power BI?

To extract the year from a date using Power BI, you can use the YEAR function, which takes in a date as input and returns the year in numeric format. Alternatively, you can use the FORMAT function, which allows you to customize the output format of a date. By specifying “YYYY” as the format, the function will return the year in four digits. Both of these functions can be used in calculated columns or measures to extract the year from a date field in your data. This makes it easy to perform year-based analysis and visualizations in your Power BI reports.


You can use the following syntax in DAX to extract the year from a date in Power BI:

year = YEAR('my_data'[Date]) 

This particular example creates a new column named year that extracts the year from the date in the Date column of the table named my_data.

The following example shows how to use this syntax in practice.

Example: How to Extract Year from Date in Power BI

Suppose we have the following table named my_data in Power BI that contains information about total sales made by some company on various dates:

Suppose that we would like to extract the year from each date in the Date column.

To do so, click the Table tools tab, then click the icon called New column:

Then type the following formula into the formula bar:

year = YEAR('my_data'[Date])

This will create a new column named year that contains only the year from the the corresponding date in the Date column:

For example:

  • The formula extracts 2022 from Saturday, January 1, 2022.
  • The formula extracts 2022 from Wednesday, January 5, 2022.
  • The formula extracts 2023 from Wednesday, February 15, 2023.

And so on.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

x