Tableau Column Difference - as a dimension
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKrJ_oWIZbKkY-AR16KeTicx2VluEpiN-GZWByXgHWWSTDaYhv6kV8GadTWhwJktEGC-RGmSHhSjJZi1_7gw6DSR5Uf7nJI1eA_dhBKuMWeJJzIzKHDhVKI-glbpmkXS5CSJ8oMBsjWQ/s640/csa-base.png)
I have got two types of values - 'Base' and 'CSA' in my data and I want to find the difference of those two values. Sounds simple right? Can you show that in Tableau? Think again. Yes you can! Problem: Googling gave me the solution to look for difference between columns and I got the difference but that was in a separate column. I wanted that in a row. Well, that essentially meant, I had to add a value in the dimension 'Valuation Profile'. How to do that? Asked this question on the tableau community and got my answer. Here is the original post. Solution: Use LOD expression to calculate the individual values first. Create calculated fields 'BASE', 'CSA' and 'CSA-BASE' as below. BASE: {FIXED [Book Name]: SUM( if [Valuation Profile] = 'BASE' then Value else 0 end ) } CSA: {FIXED [Book Name]: SUM( if [Valuation Profile] = 'CSA' then Value else 0 end ) } CSA-BASE [CSA]-[BASE]