Forum Discussion
Anonymous
4 years agoNot applicable
current date year and compare same date previous year divide
is there any option to compare current date year and same date year previous year
I have current date September 15,2021 . i want to compare same as previous year septemer 01,2021 exactly one year beofer
Data :
Period Revised closing value
01 sep 2020 45
.... .....
... .....
15 sep 2021 56
i have created measure but i am getting blank value .
%Prvs = VAR LastMAXDate = MAX ( Data[Period] )
var currentvalue = CALCULATE (
SUM ( Data[Revised closing value] ),
Data[Period] = LastMAXDate
)
var prvsyear =
CALCULATE (
SUM ( Data[Revised closing value] ),
Data[Period] = LastMAXDate-365
)
return DIVIDE((currentvalue-prvsyear),prvsyear)
i am looking for support. Thanks in advance
1 Reply
- BeaBF
Super User
Anonymous Try this:
%Prvs =var maxxx = CALCULATE(MAX(Data[Period]), ALLSELECTED(Data[Period]))var actual = CALCULATE(SUM(Data[Revised closing value]), Data[Period] = maxxx)var prevmm = CALCULATE(SUM(Data[Revised closing value]), DATEADD(Data[Period], -1, YEAR))var num = actual - prevmmRETURN (num / prevmm)Also, when creating this measure, be sure to select "decimal value" and choose 3 decimal places. Box in red:B.