Forum Discussion
bkxn226
Helper I
5 years agoRetrieve the difference between successive values in time intelligence
I have data that comes into time intelligence like this: I'm wondering if there is a quick way to take the difference between successive values. For instance q2 would be 7.5% - 7.0%....
sayaliredij
Solution Sage
5 years agoYou can try following formule
Sales Amount Prev Period Diff =
var IsSelectedQuarter = SELECTEDVALUE('Calendar'[QuarterOfYear])
var IsSelectedMonth = SELECTEDVALUE('Calendar'[MonthName])
var SalesAmountAll = CALCULATE([Sales Amount],REMOVEFILTERS('Calendar'))
Var QuarterPrev = DIVIDE(CALCULATE([Sales Amount],DATEADD('Calendar'[DateKey],-1,QUARTER)),SalesAmountAll)
Var MonthPrev = DIVIDE(CALCULATE([Sales Amount],DATEADD('Calendar'[DateKey],-1,MONTH)),SalesAmountAll)
RETURN
[Sales Amount PCT] - IF(ISBLANK(IsSelectedMonth),QuarterPrev,MonthPrev)
Thanks,
Sayali