1 Reply Latest reply on Jul 26, 2013 11:18 AM by Daniel VanderMeer

# Using a calculated field to find the percentage of total

I'm have two data sets that I need to compare, but they have vastly different units.  I would like to calculate a percentage of total value for each of the data sets by state and then graph the difference between these two percentages.

For example:

Data set 1:

StateValue

Normalized

NY100.25
NJ100.25
PA200.5

Data set 2:

StateValue

Normalized

NY15000.5
NJ10000.33
PA5000.16

I would like to plot:

Final Calculation:

State

Final Calculation

NY0.25-0.5
NJ0.25-0.33
PA0.5-0.16

Is there some way to do this calculation across data sets?  This seems pretty easy to do in excel so Tableau must have a simple solution...

Thanks in advance for any help,

-Dan

• ###### 1. Re: Using a calculated field to find the percentage of total

Dan,

Take a look at the attached packaged workbook which I believe produces the result you are looking for.

Steps:

1. Connect to data set 1

2. Connect to data set 2

3. Create a calculated field that references fields from both data sets:

SUM([Set1 (sets.xlsx)].[Normalized])-Sum([Normalized])

Hope this helps!

Daniel.