3 Replies Latest reply on Sep 4, 2018 6:40 AM by meenu choudhary

# Percentage of total

Hello,

I'd like to create calculation where I have to get sales percentage for a single product.

Here is an example what I need (bolded text):

product_name   |  sold_items |  percentage

-------------------------------------------------------------

Product 1                 10              16,66%

Product 2                 16               26,66%

Product 3                  8                13,33%

Product 4                 12               20%

Product 5                 14               23,33%

What I tried:

I created calculated field [Number of all sold items] with formula SUM(sold_items) to get number of all sold items. How can I get percentage calculation. If i create calculated field (formula: sold_items / [Number of all sold items] ) I don't get right values, because Tableau uses [Number of all sold items] for a single product sold items, not as sum of all sold (60).

Thanks for help.

Best regards

• ###### 1. Re: Percentage of total

HI Jure,

Create a calculated field like below

SUM(sold_items )/Total(SUM(sold_items ))

It will give the percentage value

Hope this helps

plz mark this answer as helpful/correct to close the thread

BR,

NB

• ###### 2. Re: Percentage of total

Hi, Jure

Try this calculation for percentage

{Fixed [product_name]:sum([sold_items])}

/

{Fixed :sum([sold_items])}

ZZ