Using a custom total calculation
In some cases, it is useful to customize the total displayed for a measure. For instance, when calculating the percentage that a measure value makes up of the total of several measures, the sum or the average of all the calculated values in the rows may not be as helpful as the calculating the percentage again based on the measures' overall totals.
|Group||A||B||A / (A+ B)|
Totals calculation rules allow you to customize how the totals are calculated.
2. Creating a custom total formula
This example will add the formula A /(A+B) as the total calculation.
To create a totals calculation rule, click on the measure in the data analysis panel to open its measure configuration dialog, then click Set up totals calculation rule formula.
The formula bar will appear.
Formulas are entered in a similar way as for a regular formula measure: formula functions and measure placeholders can be used.
When referring to a measure, a function (e.g., AVG or SUM) must be used to determine how its set of values is aggregated for your customized total. In the example above, the measures A and B both aggregate using Sum, and we will want to use the corresponding SUM function for each measure in order to calculate the overall percentage in this case. You are free to choose functions that don't correspond with the measure's aggregator if needed for your purposes.
Once you complete the formula, click Apply and then close to return to the measure configuration dialog. You can then submit the dialog when finished.
3. Other options
There are several options that can influence how the custom total formula is used.
Grand Totals Only – only applies the formula to the grand total at the beginning or end, and not the subtotals displayed when there are multiple hierarchies selected under ROWS or COLUMNS in the metric set.
Calculation Axis – determines if the custom calculation applies to the column totals or the row totals.
Use Detail Levels – If checked, grand totals use the set of data created from the details level, i.e., the lowest-selected level of the last hierarchy selected. If unchecked, grand totals are calculated using the set of values created from the subtotals.
Aggregator – The aggregation that is applied to the axis opposite that of the totals formula. If Calculation Axis is Columns, this is applied to Rows. When Grand Totals Only is selected, it is also applied to subtotals of the Calculation Axis.