Unexpected Grand Totals Results When Calculating Absolute Value

Published: 14 Sep 2016
Last Modified Date: 30 Nov 2019


When adding a grand total for a calculation using ABS(), then the grand total is wrong because the absolute value is applied to the whole total rather than to every time that contributes to the total.


Tableau Desktop


Use a level of detail (LOD) expression to set the level that the absolute value expression needs to be computed at. For example: 
  • Instead of: ABS(SUM([Profit]))/SUM([Sales])
  • Use a calculation similar to: SUM( { INCLUDE [State]: ABS(SUM([Profit])) } ) / SUM([Sales])


The Absolute function ABS() needs to be computed at a specific level.

Additional Information

The attached workbook ABS in Grant Total.twbx contains calculation examples of: 
  • Absolute Profit
  • Absolute Ratio
  • Absolute Ration (LOD)

Discuss this article... Feedback Forum
Did this article resolve the issue?