5 Replies Latest reply on Jun 4, 2016 12:57 AM by Ramesh Krishnan

# Percent of Total of numbers which are already in % terms

Hello Helpers,

I have weekly RoI data for investment in 2 categories. The RoI is already a %. I want to see each weeks RoI as a % of total.

What I did:

1. Added a quick table calculation: Percent of total

2. Edit table calculation: Table Down

Now, I get the the numbers as Percent of total, but then it's on a scale of 200% instead of 100%.

For example, for week 1, RoI of category A was 5.41% and that of B was 12.1%

So, the % of total for these should have been 30.9% and 69.1%, but the chart with table calculation shows 61.8% and 138.2% respectively!

Is there a way to scale the table calculation back to 100%?

Thanks,

Ramesh

• ###### 1. Re: Percent of Total of numbers which are already in % terms

Would not divide by 2 give you what you need?

1 of 1 people found this helpful
• ###### 2. Re: Percent of Total of numbers which are already in % terms

Hi John,

Thanks for your quick reply. This solves my problem but then, shouldn't Tableau itself be giving it on a scale of 100%?

Or is it always on a scale of 200% and we need to scale it down like this?

Thanks,

Ramesh

• ###### 3. Re: Percent of Total of numbers which are already in % terms

I think it has something to do with the way it is aggregating the total - not knowing the original measure is a ratio.  If you change your ROI calc to be row level calc [return]/[investment] it comes to 100%.  Maybe someone else can explain this better.

• ###### 4. Re: Percent of Total of numbers which are already in % terms

Yeah, seems like that. Thank you!

• ###### 5. Re: Percent of Total of numbers which are already in % terms

Hi John,

Realized that we can get what I want by using a level of detail expression.

What I did:

1. Created a new custom date field (I call it Custom Week Number) with date value of week number. Right click on the date field in the dimensions pane > create custom date > in the popup choose 'week numbers' in detail.

2. Used the below formula to calculate the ratio

{FIXED [Custom Week Number],[Investment Category]: sum([Return])/sum([Investment])}

3. Used this in the columns shelf and then added a table calc to this measure (percent of total, table down).

And I got what I wanted.

Hope someone finds this useful.

Thanks,

Ramesh