Goal: Compare 2024 sales against 2023 sales.
Watch how the formula "looks back" 1 year to fetch the old value.
Ready...
💻 DAX Formula
-- Scenario: Compare This Year vs Last Year
MEASURE Sales PY =
CALCULATE (
SUM( Sales[Amount] ),
SAMEPERIODLASTYEAR( 'Date'[Date] )
)
-- Shifts the current date context back by 1 year.