12 Replies Latest reply on Apr 26, 2018 3:20 AM by Michal Bonislawski

# Totals not calculated properly

Hi,

I have  two metrics in my table @HCPs and second %share. The problem is the second one is not summing up to 100%. The problem is the denominator which takes 58 (which is total # of HCp's each cycle - filter). How to force Tableau to take  140 as denominator to sum up % properly?

How to present % share metric summing to 100%

• ###### 1. Re: Totals not calculated properly

Hi Micahl,

You can create a separate denominator calculated field as : Total(Sum([field])).

HTH

Regards,

Jayshree Dawrewar

2 of 2 people found this helpful
• ###### 2. Re: Totals not calculated properly

The formula would look then like Total(Sum([# HCPs])) which is not valid.

I can not do further aggregation because # HCP's is already an aggregation. # HCP's = Countd(DWH Customer ID)    :-(

• ###### 3. Re: Totals not calculated properly

try doing: Total (Countd (DWH customer ID)

I am not ableato open your workbook....

Regards,

Jayshree

1 of 1 people found this helpful
• ###### 4. Re: Totals not calculated properly

You can't use the normal table calculations in this example, so create a calculated field like this :

COUNTD([Dwh Customer Id])/WINDOW_SUM(COUNTD([Dwh Customer Id]))

and use that on your % column

2 of 2 people found this helpful
• ###### 5. Re: Totals not calculated properly

Hi Michal,

to create #HCPs calculated field you can use LOD as below

{ INCLUDE  [#of Users LoA] : COUNTD([Dwh Customer Id])}

Then you can use the same in table calculation

Regards,

Anupam

• ###### 6. Re: Totals not calculated properly

Just remember that you don't HAVE to use an LOD, there are other ways to do this

• ###### 7. Re: Totals not calculated properly

True!

• ###### 8. Re: Totals not calculated properly

Thx Chris - this one works perfectly :-)