O'Reilly logo

MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition by Sherry Li, Tomislav Piasevoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating various averages

This is the second recipe in our series of relative calculations. In the previous recipe, Calculating various percentages, we created calculated measures for Parent %, Level %, Hierarchy %, and Leaves %. We used the ragged Sales Territory hierarchy of the Sales Territory dimension. There is a good introduction to ragged hierarchies in the previous recipe.

In this recipe, we will continue to use the ragged Sales Territory hierarchy of the Sales Territory dimension. We are going to show how to calculate the average among siblings, average in the level, average in the entire hierarchy, and average on leaves.

Getting ready

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required