Every measure is calculated and shown in the Power BI Visuals according to the current filter context.
Total Sales = SUM('SalesFactTable'[Sales])
PY Total Sales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('DateTable'[Date]))