4 Replies Latest reply on Jul 3, 2017 12:00 AM by venkat.gunda

# Difference between values in same row

My data looks something like this :

Category
Sub Category
Date
Type
Amount
T1AAA1/1/2015Act 1234
T1AAA1/1/2016Act YTD5678
T1AAA1/1/2017Plan9856
T2BBB1/1/2015Act4578
T2BBB1/1/2016Act YTD6325
T2BBB1/1/2017Plan7856

How do I find the difference between the values for 2016 Act YTD and 2017 Plan in % for each category?

• ###### 1. Re: Difference between values in same row

Hello Toh,

Refer the below snapshot, if this is what you are looking for then i have attached the workbook for your better understanding.

Ak

• ###### 2. Re: Difference between values in same row

Hi, the Tableau version in my work laptop now is currently an older version compared to yours so i can't view your workbook now. May i know how did you achieve the results? Is the percentage an increase/decrease from 2016 Act YTD to 2017 Plan? Thank you!

• ###### 3. Re: Difference between values in same row

Which version are you using?

Create below calculated fields.

1) Act YTD = IIF([Type]='Act YTD',[Amount],0)

2) Plan = IIF([Type]='Plan',[Amount],0)

3) Percentage = LOOKUP(SUM([Act YTD]),FIRST())/LOOKUP(SUM([Plan]),1).

Use them as below snapshot.

• ###### 4. Re: Difference between values in same row

pls send me the attached twbx file

Regards,

venkat