PREVIOUSYEAR Function (DAX)

How does the PREVIOUSYEAR function (DAX) work?

The PREVIOUSYEAR function (DAX) returns a table that contains a column of all dates from the previous year, given the last date in the dates column, in the current context.

PREVIOUSYEAR Formula Syntax

PREVIOUSYEAR(
     <dates>[,<year_end_date>]
)

How do you use the PREVIOUSYEAR function?

This function returns all dates from the previous year given the latest date in the input parameter. For example, if the latest date in the dates argument refers to the year 2009, then this function returns all dates for the year of 2008, up to the specified year_end_date.

The dates argument can be any of the following:

  • A reference to a date/time column,
  • A table expression that returns a single column of date/time values,
  • A Boolean expression that defines a single-column table of date/time values.

Related Blog Posts

Related Support Forum Posts

Year-Over-Year Variance Buckets
Breaking up year over year changes into component parts
PREVIOUS YEAR REVENUE to current year rate

Considerations when using the PREVIOUSYEAR function

The year_end_date parameter is a string literal of a date, in the same locale as the locale of the client where the workbook was created. The year portion of the date is ignored.

Related Video Tutorials

Formula examples using the PREVIOUSYEAR function

=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PREVIOUSYEAR(‘DateTime'[DateKey]))

Related DAX Functions

previousmonth
PREVIOUSQUARTER

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership