4 Replies Latest reply on Oct 3, 2016 11:19 PM by Crystal Ng

# Difference between two columns

Hi All,

I'm trying to calculate the difference between two columns in a table. The two columns are the 'Market Share %' calculated based on the volume, and I would like to know the Market Share increase (Simply 2016 minus 2015).

But since these two columns are calculated fields based on volume, I'm not able to perform another table calculation for the column difference.

I'm not keen to add market share to my data source as a lot of the calculations are of different segments.

Crystal

• ###### 1. Re: Difference between two columns

Hi Crystal,

I have one way(may not be the easiest) to do this.

PFA

Is this what you are looking for ??

Best

Shriram Saxena

• ###### 2. Re: Difference between two columns

Hi Shriram,

I'm using Tableau 9.2 and I can't open the file. Would your method work on 9.2? Thanks.

Regards,

Crystal

• ###### 3. Re: Difference between two columns

Hi Crystal,

Yes Definitely it will work.

LOOKUP(SUM([Profit]) / TOTAL(SUM([Profit])),0) - LOOKUP(SUM([Profit]) / TOTAL(SUM([Profit])),-1)

Best

Shriram Saxena

• ###### 4. Re: Difference between two columns

Hi Shriram,

This would work in your example because the % of profit is calculated based on table across (Date). However in my example the % is calculated based on table down (Total product), when I use your formula in my example, I get the result below:

Kind Regards,

Crystal