DAX code
Previous Year YTD Sales =
CALCULATE(
[Total Sales],
DATESYTD(SAMEPERIODLASTYEAR('Date'[Date]))
)
Calculates year-to-date sales as of the same point in the previous year, for comparing YTD progress.
Type your table and column names once. Every measure below updates.
Previous Year YTD Sales =
CALCULATE(
[Total Sales],
DATESYTD(SAMEPERIODLASTYEAR('Date'[Date]))
)
Generate a Power BI date table
Requires a marked Date table; swap DATESYTD's default year-end if your fiscal year doesn't end December 31.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Previous Year YTD Sales.