KNOWLEDGE BASE

Unable to Calculate Grand Total of a Weighted Average Using Table Calculations


Published: 23 Sep 2016
Last Modified Date: 04 Sep 2017

Issue

When using Table Calculations to find a weighted average, the Grand Total of the weighted average is not evaluating as expected.

Environment

Tableau Desktop 9.0 and later versions

Resolution

Option 1

If the percentage out of all [Category] values is being calculated across [Category] using SUM([Value]) / TOTAL(SUM([Value])), instead use:

SUM({EXCLUDE [Category]: SUM([Value])})

Option 2

If the weighted average is calculated as SUM([Value Occurrence])*([Percentage]) then use the following calculation instead:

SUM({INCLUDE [Category]: SUM([Value Occurrence]*[Percentage])})
Using {INCLUDE} causes the Grand Total to be calculated as the sum of the weighted averages for the [Category] values in the view.

Cause

Grand Total ignores the percentage calculation; Table Calculations are evaluated last.
Did this article resolve the issue?