Forum Discussion
RekhaG
9 years agoFrequent Visitor
Previous Year - Measures - Non Contiguous Date Selection
I have created Previous Year Measure using different formulas(in Tabular SSAS Cube) as below: but when I select them in PowerBI for non-contiguous months, nothing shows up, the service keeps shwoing...
- 9 years ago
Thanks Bhavesh.
The formula below worked for me
PrevYear:=CALCULATE(sum('Table'[Column]), PARALLELPERIOD('DateTable'[Date],-12,MONTH))
BhaveshPatel
9 years agoSuper User
Hi Rekha
Please try these measures for previous year calculation. Make sure you have a date table in your data model.
PrevYear:=CALCULATE(SUM(Table[Column]),DATEADD('Date'[Date],-1,YEAR))
OR
PrevYear:=CALCULATE(SUM(Table[Column]),SAMEPERIODLASTYEAR('Date'[Date]))
Thanks & Regards,
Bhavesh
RekhaG
9 years agoFrequent Visitor
Thanks Bhavesh.
The formula below worked for me
PrevYear:=CALCULATE(sum('Table'[Column]), PARALLELPERIOD('DateTable'[Date],-12,MONTH))