How can I extract the year from a date in Power BI?

“Extracting the year from a date in Power BI can be achieved through various methods, including using the DAX formula or the Power Query Editor. By utilizing these tools, users can easily manipulate and extract the desired year from a given date, allowing for better analysis and visualization of data. This feature in Power BI provides a streamlined and efficient approach to retrieving the year from a date, enhancing the overall functionality and accuracy of the platform.”

Power BI: Extract Year from Date


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