I have a single table in Powerpivot.
My columns are Account, Amount and Date. I want to calculate PrevYearAmount, but I can't fin the correct formula.
Sample data:
Account Amount Date PrevYearAmount
1 100 01/01/2016 90
1 120 02/01/2016 200
2 130 01/01/2016 108
2 103 01/01/2015
2 105 01/01/2015
1 90 01/01/2015
1 200 02/01/2015
tried
=CALCULATE(SUM(Hoja1[Amount]);FILTER(Hoja1;DATEADD(Hoja1[Date];-1;YEAR));FILTER(Hoja1;Hoja1[Account]))
But this returns 350 for all rows.
Also tried:
=CALCULATE(SUM(Hoja1[Importe]);DATESYTD(SAMEPERIODLASTYEAR(Hoja1[Fecha])))
but returns blank