Forum Discussion
previous year calculation with time filter
- 9 years ago
Hi RMV
When you created your date table did you create the relationships?
I created the following measures based on your dataset.
My Amount = SUM(Table1[Amount]) YTD = TOTALYTD([My Amount],'Date'[Calendar Date]) Previous Yr My Amount = CALCULATE([My Amount],PREVIOUSYEAR('Date'[Calendar Date]))Which then gave me the following correct output.
Hi GilbertQ,
I tried it, and still got blank as the result.
Need further advise on what goes wrong.
I created a date table, add a measure column = CALCULATE(SUM(Table[Amount]),PREVIOUSYEAR(DateCalendar[Date]))
In the table matrix visualization:
Category Amount YTD Amount Previous Year
(column from Table) (measure from Table) (measure from DateCalendar)
Tried CALCULATE(SUM(Table[Amount]),SAMEPERIODLASTYEAR(DateCalendar[Date]))
It results blank too.
Hi RMV
When you created your date table did you create the relationships?
I created the following measures based on your dataset.
My Amount = SUM(Table1[Amount])
YTD = TOTALYTD([My Amount],'Date'[Calendar Date])
Previous Yr My Amount = CALCULATE([My Amount],PREVIOUSYEAR('Date'[Calendar Date]))Which then gave me the following correct output.