Calculating various percentages
This recipe and the next two recipes show how to calculate relative percentages, averages, and ranks. We are starting with percentages in this recipe.
Having a ratio of a current member's value over their parent's value is an often-required calculation. It's a form of normalizing the hard-to-grasp values in the table. When the individual amounts become percentages, it immediately becomes clear where the good or bad values are.
There are many kinds of percentages or shares, but we'll take the typical three and present them in this recipe. These are: percentage of the parent's value, percentage of the level's total, and percentage of the hierarchy's total.
This recipe will show how to calculate them using the ragged ...
Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.