Calculating parallel periods for multiple dates in a slicer

In the Calculating the year-over-year (YoY) growth (parallel periods) recipe, we have shown how the ParallelPeriod() function works when there is a single member involved. In the Calculating parallel periods for multiple dates in a set recipe, we have shown how to do the same, but on a range of members defined in a set. This recipe presents the solution to a special case when the set of members is found in a slicer.

Getting ready

We will use the same case as in the previous recipe; we will calculate the growth in the pre-Christmas season for each color of our products.

Start SQL Server Management Studio and connect to your SSAS 2016 instance. Click on the New Query button and check that ...

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

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