5 Replies Latest reply on Jan 18, 2017 6:38 AM by Fabian Gantner

# Correct %-deviation calculation in Grand Total

Hi, I have a question concerning the correct calculation of totals in calculated fields. For a better understanding I attached an excel with the crosstab of my Tableau Workbook.

The problem I have you can see in column I, J and K. The Grand Total calculations are showing the wrong result (see line 3). Correct calculation I added to line 1. In column I and J I can switch to "Total using Sum". But I need the two reults from I and J to calculate the correct result for K. Any ideas how to solve this issue within Tableau?

Thanks!

• ###### 1. Re: Correct %-deviation calculation in Grand Total

I suspect that this post may help. To summarize, Tableau calculates totals by computing the calculation at a higher level of aggregation, not by adding all visible marks. The post lists a number of potential workarounds that may be helpful in your case.

1 of 1 people found this helpful
• ###### 2. Re: Correct %-deviation calculation in Grand Total

Hi Fabian,

Since I don't have your workbook, I cannot tell you what went wrong. But I put your data into tableau and it calculated it exactly how you specified. I added a calculation called % Saving Answer = SUM([Total Savings Eur])/SUM([YTD-Qty * Np3 Eur LY]). In Sheet 1, I just dragged the values on a table. In Sheet 2, I used the Column Grand Total function from the analysis to come up with the same answer.

• ###### 3. Re: Correct %-deviation calculation in Grand Total

Hi, I'm using Tableau 10.0 and can't open your sample workbook...can you save it in 10.0?

But anyway, I dont think that it will help a lot, as you are just using an aggregated function. But the data in the excel is allready aggregated

• ###### 4. Re: Correct %-deviation calculation in Grand Total

Hi Fabian,

Do you mind posting your workbook as tbwx then? I just did the math on what you posted.

• ###### 5. Re: Correct %-deviation calculation in Grand Total

Attached the tbwx and another Excel to better understand the Problem...