PREVIOUSYEAR
The dates of the year before the first date in the filter context (the year ending on 31 December, or on a date given).
Group: Time intelligence. Compatible with DAX.
Syntax
PREVIOUSYEAR ( <dates> [, <year_end_date>] )
| Parameter | Type | Description |
|---|---|---|
dates | Dates | A column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model. |
year_end_date | Text optional | The year's last day as month and day, such as "6-30" for a year that ends on 30 June; when left out, 31 December. Not used with a calendar, whose own years count. |
Returns
Table. The dates the column holds in the year before the first date in the filter context.
Remarks
- The whole previous year comes back, whatever part of the current year is selected.
- With a year end, the years are those that end on it.
- Only dates the column holds come back: a date the move or the period lands on that the column lacks is left out, and when none is left the table is empty.
- Given a column, it reads the dates visible in the current filter context; in a row context, such as
ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates. - Given a calendar instead of a column, it works on the calendar's own periods (fiscal years, retail months of four or five weeks, ISO weeks). A filter on a category the calendar does not define, such as a month on a calendar of weeks, can make the call an error.
Examples
The whole year before, from one month
From March 2026, all 261 business days of 2025.
EVALUATE
CALCULATETABLE (
ROW (
"Days", COUNTROWS ( PREVIOUSYEAR ( Prices[Date] ) ),
"From", MINX ( PREVIOUSYEAR ( Prices[Date] ), Prices[Date] ),
"To", MAXX ( PREVIOUSYEAR ( Prices[Date] ), Prices[Date] )
),
Prices[Month] = DATE ( 2026, 3, 1 )
)
| Days | From | To |
|---|---|---|
| 261 | 2025-01-01 | 2025-12-31 |
Liters of the year before
The same total for every month of 2025: all of 2024.
EVALUATE
ADDCOLUMNS (
DATESBETWEEN ( Sales[Month], DATE ( 2025, 1, 1 ), DATE ( 2025, 3, 1 ) ),
"Liters", [Liters sold],
"Year before", CALCULATE ( [Liters sold], PREVIOUSYEAR ( Sales[Month] ) )
)
ORDER BY Sales[Month]
| Sales[Month] | Liters | Year before |
|---|---|---|
| 2025-01-01 | 44635 | 586171 |
| 2025-02-01 | 44831 | 586171 |
| 2025-03-01 | 43593 | 586171 |
Related functions
NEXTYEAR, SAMEPERIODLASTYEAR, PARALLELPERIOD, OPENINGBALANCEYEAR.