Forum Discussion
SamesPeriodLastYear vs Using Var + Return
Hi there!
I've recently completed a finance-oriented course on DAX and Power Pivot/BI.
When calculating sales growth in dollar $ terms the instructor offered 2 different solutions, but with a different outcome:
Measure 1: SalesPY:=CALCULATE([Sales],SAMEPERIODLASTYEAR(Dim_Dates[Date]))
Measure 2:
Sales$Growth:=var PYSales = CALCULATE([Sales],SAMEPERIODLASTYEAR(Dim_Dates[Date]))
return [Sales] - PYSales
The outcome is different one from the other.
Thanks in advance!
Because they are two different calculations. The 2nd measure returns the difference between the current year and the previous year which is clearly indicated by the measure name.
1 Reply
- tamerj1Community Champion
Because they are two different calculations. The 2nd measure returns the difference between the current year and the previous year which is clearly indicated by the measure name.