Problem:
Calculate the total for period of prior year of the period(s) selected in slicer. Table has amount, period, and a date, ie 11/1/2020 for period 11/2020, based on the period.
Attempted:
Slicer periods selected are 10/2020 and 11/2020. Table visual contains the period and amount columns. Data Model Table contains columns, account, amount, period, and period date. Multiple accounts per period will have the same period date, to sort the periods. Example, account 1 through 3 will all have 11/1/2020 as period date for period 11/2020. Calculated Measure created to calculate last year amount is as follows:
Total For Period Last Year = CALCULATE( Sum(‘Table’[Amount]) , Filter( ‘Table’ ,SAMEPERIODLASTYEAR(‘Table’[Period Date]) ) )
Results:
Calculated measure is added to table but only shows the amount for the period selected in slicer and not the period for the same period but of the prior year. So 10/2020 amount would be $2000 and the calculation should show amount for 10/2019 with ie $1500.
Period | Amount | Total For Period Last Year
11/2020 $2000 $2000
10/202. $1500 $1500
Desired Result: