6 Replies Latest reply on Sep 6, 2018 7:53 PM by meenu choudhary

# Cost Calculation

Hi,

In my Invoice i have two line for the same product sold in different quantities. The invoice looks as shown below.

 Line Type Code Qty Cost Total cost Model abcd 3 82.4 247.20 Model abcd 4 82.4 329.60 7 82.4 576.80

In Tableau it is calculating as shown below :

 Line Type Code Qty Actual Cost In Tableau Model abcd 7 164.80 1,153.60

The problem in tableau, it is adding the cost 82.40+ 82.40 = 164.80.  but the actual cost is 82.40 per piece.

my calculation formula :

 IF [LineType]='Model' THEN [ModelStandardCost] * [TG Qty] END

Thanks

Krishna.

• ###### 1. Re: Cost Calculation

Can you please attach the sample workbook

• ###### 2. Re: Cost Calculation

Hi,

Are you expecting below result:

Here i just converted, "Cost" and "Qty" Discrete Dimension ()you can just drag both to dimension shelf)  and used the logic:

Total sales  = ([Qty])*([Cost]).

Go to analysis-> Totals -> column Grand Totals.

• ###### 3. Re: Cost Calculation

Hi Meenu,

Thanks for the suggestion.  I have tried with that formula before but did not produce the correct results. I will try again.

Regards

Krishna.

• ###### 4. Re: Cost Calculation

HI ,

I guess you missed to convert the values as dimension/discrete.

• ###### 5. Re: Cost Calculation

Hello Meenu,

I did everything but  still not accurate.  Is there a way i can contact you?

Thanks

Krishna.

• ###### 6. Re: Cost Calculation

Hi,