7 Replies Latest reply on Jun 3, 2016 12:02 PM by Ramesh Krishnan

# Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Pooja Gandhi

Hello Experts,

I have an aggregate measure, which is a ratio (could be greater than 1). When I try to calculate % of Total, I am not getting the expected result.

Below is the screenshot of just the measure (without the table calc).

Below is the screenshot of the measure with the % of total calculation. I added table calc and chose table down.

I expected the measure to be scaled to 100%, something like the below image (I got this using a single measure, not the aggregated ratio measure)

Please tell me what I am missing here!

Thanks,

Ramesh

• ###### 1. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Ramesh,

Are you able to send some examples of the Ratio data.

Can you also provide the Ratio Calculation. This would help immensely.

Thanks

Al

• ###### 2. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Apologies I see you have queried this twice within the community

• ###### 3. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Have attached the file. Please take a look!

• ###### 4. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Ranesh,

Create a new calculated field called New Ratio.

Within this calculated field insert the following

{ INCLUDE [Category], [Start Date] : sum([Numerator])/sum([Denominator]) }

Now duplicate your sheet 2, Replace Agg(Ratio) with New Ratio.

Select Quick Table Calculation - Percent of Total

Compute using Category.

I used the initial ratio volumes from the first few weeks and tested these to determine this calc so please feel free to test the outcome more thoroughly.

Kind Regards

Alastair

1 of 1 people found this helpful
• ###### 5. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

If you have week level of detail in the view, you are actually going to need to create a custom date. Right click on the date field in the dimensions pane > create custom date > in the popup choose 'week numbers' in detail. Then use that field in your calc and do percent of total down.

{ fixed [Start Date (Week numbers)], [Category]: sum([Numerator])/sum([Denominator]) }

1 of 1 people found this helpful
• ###### 6. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Thanks Pooja! This helped me!

• ###### 7. Re: Challenge for Tableau Experts: How to create % of Total for Aggregate Measures? Need it scaled to 100%

Thanks, Alastair! A small modification was suggested by Pooja and it works like a charm!