7 Replies Latest reply on Jul 8, 2015 8:16 AM by jonathan.o'grady.0

calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Hi

I have a challenge with Tableau that I hope any of you could help me out with. I have a data set with actual sales per item and forecasted sales per item. I'm interested in seeing a single item's sales in relation to the total sales, both actual and forecasted. This I can manage with a quick table calculation (see picture below). However, I would as well want to see the percentual difference between these two columns, but I can't find out how. The desired extra column is visible in green in the second picture.

Any advice on how this could be arranged is greatly appreciated!

Best regards

Markus Nosko  • 1. Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Hi Markus,

You can create a calculated field with an equation same as below, replace Sales and Forecast measure names with your measure names.

% Total Variance=(SUM([Sales]) / TOTAL(SUM([Sales])))-(SUM([Forecast]) / TOTAL(SUM([Forecast]))) • 2. Re: Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Sample workbook attached.

• 3. Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Thanks a lot Indumon. Both for quick reply and a good answer that helped me out! :-)

• 4. Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Hi,

By using quick table calculation we get the percentage of total.

Regards,

Muthu Krishnan. M

• 5. Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

Muthu,

This answer is very helpful, thank you. However, I have a further nuance which you might be able to help me with please?

I am similarly trying to calculate the percentage difference between two calculated columns.

My issue is that I only have one measure. My columns are segregated by dimension.

For example:

Total sales

By sales rep

By region

The sales figure is the only measure I have. I would like to calculate the percentage difference between sales by sales rep at the regional level.

The solution you've posted above won't work. I've tried a look up but can't find an elegant solution.

Many thanks!

Jonathan

• 6. Re: calculate the percentage difference between two colums that contains percentage values (from a quick table calculation)

We are also having the exact same challenge. Any ideas?