Calculating the year-over-year (YoY) growth (parallel periods)
This recipe explains how to calculate the value in a parallel period, the value for the same period in a previous year, previous quarter, or some other level in the date dimension. We are going to cover the most common scenario—calculating the value for the same period in the previous year, because most businesses have yearly cycles.
A ParallelPeriod()
is a function that is closely related to time series. It returns a member from a prior period in the same relative position as a specified member. For example, if we specify June 2012 as the member, Year as the level, and 1 as the lag, the ParallelPeriod()
function will return June 2013.
Once we have the measure from the prior parallel period, we can calculate how much the measure in the current period has increased or decreased with respect to the parallel period's value.
Getting ready
Start SSMS and connect to your SSAS 2016 instance. Click on the New Query button, and check that...