
Explanation:
Total Sales LY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) The above formula uses the CALCULATE function to calculate the [Total Sales] measure and the SAMEPERIODLASTYEAR function to return the same period of the previous year from the 'Date' table.
https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables
https://learn.microsoft.com/en-us/power-bi/guidance/star-schema#role-playing-dimensions