Forum Discussion
Comparing Last Year Sales Values
- 8 years ago
Hello,
please provide us the formula how you calculated SumLYLineValue.
Did you use Sameperiodlastyear or DateAdd(DateTable;-1;Year)?
Hi, thanks for the response.
This measure was calculated using the following:
SumLineValue = SUM('Sage Data'[Line Value])
SumLYLineValue = CALCULATE([SumLineValue],SAMEPERIODLASTYEAR('Sage Data'[Order Date].[Date]))
Would the DateAdd command be more appropriate or is it functionally identical?
Thanks,
Hello,
the functions are similar.
DateAdd is great if you want to move back or forward day or months. In your case Sameperiodlastyear is great.
Do you have a contigous date table?
In such cases it's usually the best to have a separate date table which you relate to your date colum.
Then you calculate with Sameperiodlastyear(DateTable[Date]) and you put the Date data to your Pivot.
I'm not sure but this may cause your trouble.