3 Replies Latest reply on Jul 28, 2016 3:42 AM by Ben Neville

# Incorrect Calculation Result

Hi Friends,

I need some help regarding a calculation which which I am trying to achieve.

The requirement is there should be an action filter from the first Dashboard to Second dashboard.

From First Dashboard we select the state on the second dashboard we see the Districts of the selected state, the count of districts(of the selected state) and the sum of a field "Has two or more A"

PFA the excel sheet and the workbook. For some reason the result of this field "Has two or more A" is not coming properly.

Eg: Dashboard 1 -  Selected State Andhra Pradesh -> Dashboard 2 -> District overview & District count is coming correctly. But the field "Has two or more A" is showing the result as 12. Correct result is 4.

Regards,

• ###### 1. Re: Incorrect Calculation Result

Hi Somok,

Change the aggregation from Sum() to Avg() for "Has two or more A". Refer below screenshot. Also find the tableau workbook attached below.

This was happening because you are getting 3 records for all the districts. See the screenshot for the Adilabad and you were taking it as a Sum instead of Average. Thus result was 3 instead of 1.

Thanks and Regards,

-Ashish Chaudhari

• ###### 2. Re: Incorrect Calculation Result

Hello Somok,

SUM({ FIXED [State],[District]:AVG([Has two or more A])})

Regards.

• ###### 3. Re: Incorrect Calculation Result

In your case, an Average will not work, as it averages 1s and 0s. Your result will always be greater than 0 and less than 1. If you are trying to count the Districts with 1 values, I would suggest the following:
COUNTD(IF [Has two or more A] = 1 THEN [District] END)