PREVIOUSYEAR DAX Function
The function returns a table that contains a single column of all dates from the previous year, given the latest date in the dates column, in the current context.
For example, if the latest date in the dates argument is 7 June 2009, then this function returns all dates for the year of 2008, up to the specified year_end_date. The default year_end_date is December 31. Therefore, it returns all the dates from 1st Jan 2008 to 31st Dec 2008.
DAX Syntax PREVIOUSYEAR(dates[,year_end_date])
The function has the following parameters:
- dates : A column containing dates.
- year_end_date (optional) : A literal string with a date that defines the year-end date. The default is December 31. The year portion of the date is ignored.
Example: Create a measure, by using the following expression that calculates the Sum of previous year income.
DAX
Here, the value 15931000 comes from the sum of Annual Income column values of dates from 1st Jan 2005 to 31st Dec 2005.