3 Replies Latest reply on Aug 19, 2016 11:17 AM by David Li

# Wrong value in Running total of Average of a Numeric Field

Hi All,

Below is question:

When I take running total of average(numeric field), then I am not getting the correct grand column total value.

Example :

[Running total(Avg(sales))]

21

32

54

Column Total should be  21+ 32+ 54= 107 But it is giving a different value. This is happening only when I use "running total of average(numeric field)".

I am getting the correct grand column total value when I use "Running total of sum(numeric field)".

Can someone help me on this?

• ###### 1. Re: Wrong value in Running total of Average of a Numeric Field

Hi Sandeep! You're running into this problem because Tableau grand totals function by removing all the aggregation breakdowns (except the ones that still exist at the grand total level). This means that the grand total of RUNNING_SUM(AVG(Sales)) actually just becomes AVG(Sales) for all rows, because the grand total takes out the breakdowns that the RUNNING_SUM worked on.

I think the easiest way to get around this is to use an LOD calculation. Here, we'll force the breakdown back in. Let's say that my LOD (that is, the thing that the running sum is rolling along) is called State. Create this custom calc:

{ INCLUDE [State] : AVG([Sales]) }

Once you have that, add it to your viz and use the quick table calculation for running sum on it.

1 of 1 people found this helpful
• ###### 2. Re: Wrong value in Running total of Average of a Numeric Field

Hi David LI,

WOW! It's an amazing answer.It worked for me perfectly. You don't believe that I spent hours and hours on this before I post in community.

Thank you very much for all your effort and help on this.

Best Wishes,

Sandeep