Forum Discussion
Year over Year calculation
- 9 years ago
Hello,
To Visits
SumVisits= Calculate([Sum(Table[Visits]))
VisitLastYear= Calculate([SumVisits],DATEADD(Table[Date],-1,YEAR))
YoYVisits = [SumVisits]/[VisitLastyear]-1
To PageViews only change Visits column to Page Views Column.
To get YoY you need the difference ( [SumVisits] - [VisitLastyear] ) divided by Last Year's number
I personally also have a Measure calculating this difference
Regardless... when you use - 1 you get the same result see below...
The basic formula is
( [SumVisits] - [VisitLastyear] ) / [VisitLastyear]
however this can be written as
( [SumVisits] / [VisitLastyear] ) - ( [VisitLastyear] / [VisitLastyear] )
which can in turn be simplified as
( [SumVisits] / [VisitLastyear] ) - 1
Division will be executed before subtraction so need for the parenthesis which I've included anyway
Hope this helps!