3 Replies Latest reply on Sep 19, 2017 8:53 AM by Mike Penland

# % of Total Field Calculation V10.0

Hello,

I am trying to make a formula in tableau that finds the percentage of each contract from a year that it makes up of the entire year's contract value. Basically, to divide a value from each row that belongs to a certain group or multiple (year, region, customer) by the total summed value of all rows who are part of the same group. In the example provided, I'm looking for a formula that will divide the contract value of each item by the summed contract value for the year the contract was made, and return a percent contribution to that total. I.e. for Chairs in 2016, the desired calcuation would be 54000/194400=.28 or 28%. In the example I provide it's easy because the data is so small, but can get very tedious and time consuming in larger files and I'm looking for a formula that is universal (or close) and allows me to manipulates the factors/groups that decide which contracts will be included.

I'm not sure explained this well, but any help would be greatly appreciated, thanks in advance

• ###### 1. Re: % of Total Calculated Field

Hi Mike - i am on a different version of tableau so you would not be able to open an attachment

Have you tried the table cacluation shown below?  if your real data has multiple dimensions you can still use the approach and select specific dimension to set the order of caclulations and then select the restart every option if needed

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 2. Re: % of Total Field Calculation V10.0

Hi Mike,

Create a calculated field :

{ FIXED [Contract Year],[Item]:SUM([Contract Value])}/{ FIXED [Contract Year]:SUM([Contract Value])}

this will give the percent of total as per requirement.

4 of 4 people found this helpful
• ###### 3. Re: % of Total Field Calculation V10.0

Hari,

Exactly what I was looking for. Thanks for the help and I'm sure this is going to help me in many other situations in the future