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 ...

Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.