6 Replies Latest reply on Nov 5, 2017 3:01 PM by Tableau Admin

# Sales vs Target Calculation

Hi forum,

I currently have 2 Sheets.

• 1st sheet with Sales data which belongs to Principal A,B & C and their daily transaction.
• 2nd sheet is the individual Principal A,B & C's target as a whole number.

I've linked both sheets to get the principal target. Then to calculate Achievement  (Sales/Target) %

Problem is when i drag Sales & Target Measures into the table,  the Target registers as a sum of all the target for all transactions but in actual I just need 1 figure.

How do I solve this? I've tried using Avg(Target) but is there a better way to extract the Target ?

Attached are my workings.

Below is the final result that i require.

 Principal Name Principal Code Sales Target Achievement PRINCIPAL A 101202 992,463 1,015,607.22 98% PRINCIPAL B 100226 7,787,178 8,141,884.28 96% PRINCIPAL C 100197 1,993,906 2,658,274.91 75%

Hope you can help as Im very new to Tableau.

• ###### 1. Re: Sales vs Target Calculation

See this one.

1 of 1 people found this helpful
• ###### 2. Re: Sales vs Target Calculation

Thanks! It's exactly what I wanted. Can I know what did you do?

• ###### 3. Re: Sales vs Target Calculation

Instead using a join, i created a union.

Edit datasource in order to understand.

This is possible only in tableau 10.

• ###### 4. Re: Sales vs Target Calculation

Thanks, i got it to work, but union only works on Sheets within the same Excel file and not 2 separate files right?

Also, If I need to show target by months, how should I prepare the format so it works like when comparing the total target.

Hope you can assist.

Thanks.

• ###### 5. Re: Sales vs Target Calculation

Yes, in 9.3 version only sheets on the same excel.

Second situation:

You can break target Including date field with exactly same name of date field on Running.

Maybe you don't have targets by day, but you should force one. On analisys you show per month.

• ###### 6. Re: Sales vs Target Calculation

Is there a way to do this without doing a union?

I am using a stored procedure and every time I try to union the procedure with an excel sheet Tableau 10.4 crashes.