DAX code
Previous Year Sales =
-- DATEADD shifts the current filter context back a full year, whatever that context is
CALCULATE([Total Sales], DATEADD('Date'[Date], -1, YEAR))
Shifts the current filter context back exactly one year and re-evaluates sales.
Type your table and column names once. Every measure below updates.
Previous Year Sales =
-- DATEADD shifts the current filter context back a full year, whatever that context is
CALCULATE([Total Sales], DATEADD('Date'[Date], -1, YEAR))
Generate a Power BI date table
DATEADD works with any selected period (a day, a month, a year), not just a full year, which is why it's generally preferred over PREVIOUSYEAR.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Previous Year Sales.