Forum Discussion
Anonymous
6 years agoNot applicable
SAMEPERIODLASTYEAR in a Calculated Column
Hi, I need the Sales Last Year (Sales LY) as a Calculated Column in my Data Base so I can compare Sales vs Sales LY in a Scatter Chart by Peer. My problem is that when I apply the SAMEPERIODLASTYEA...
Anonymous
6 years agoNot applicable
Thanks for your answer, I have tried the below but is still not giving me the Last Year Value for the Account Selected.
Value LY =
VAR ayearago =
DATE ( YEAR ( Append1[Date]) - 1, MONTH ( Append1[Date] ), DAY ( Append1[Date] ) )
RETURN
CALCULATE (
SUM ( Append1[Value] ),
ALL ( Append1 ),
Append1[Date] = ayearago,
VALUES ( Append1[Peer] ), VALUES(Append1[Cons Lvl]), VALUES(Append1[Period View]), VALUES(Append1[Account]), VALUES(Append1[Region]),VALUES(Append1[Source Date]), VALUES(Append1[Source])
)
Anonymous
6 years agoNot applicable
Just for clarification, My Period View includes only 3 dimensions QTD, YTD and LTM. YTD and LTM are not necessarilly the sum of the Quarters since due to rounding several companies does not make that precise. So the data base has all 3 of them as a Value for each Peer.