
1. Re: How to calculate difference between percent of total percentages
Sasha Hanna Apr 6, 2018 8:14 AM (in response to Karan Kumar)Hi Karan,
To create the difference of your percentages in another table, you will need to create the percentages as new measures. The problem lies in that table calculations are computed locally and depend on the fields in the view. There is a way to create these fields using level of detail expressions, however, and there is a step by step of how to create these in Exercise 4: Top 15 Tableau LOD Expressions (Practical Examples).
Let me know how you get on and if you need any further assistance.
Cheers,
Sasha

2. Re: How to calculate difference between percent of total percentages
Jim Dehner Apr 6, 2018 8:33 AM (in response to Karan Kumar)Good morning
please see the attached approach
first calculate percent of total with an LOD (not table calculations
then use a lookup function to calculate the difference
in a text table it returns this
or in a summary it looks like this
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.

difference in percents.twbx 1.2 MB


3. Re: How to calculate difference between percent of total percentages
Karan Kumar Apr 10, 2018 1:33 AM (in response to Jim Dehner)Thank you Jim. And apologies for being late to reply.
Your solution would perfectly work in a normal scenario. However, I am having trouble implementing this in my case. I cannot use LOD expressions in my calculations since I have multiple data sources using blend.
If I try to use table calculation "SUM(Sales)/TOTAL(SUM(SALES))" for percent of total value then I have to tell Tableau to compute the results using Table(down). But while calculating the difference this calculation still computes the result using default table calculation(Table(across)) and gives me incorrect results.
Thanks,
Karan

4. Re: How to calculate difference between percent of total percentages
Karan Kumar Apr 10, 2018 3:46 AM (in response to Sasha Hanna)Thanks Sasha. Please see my other post for the issue I am facing with this approach.
Karan

5. Re: How to calculate difference between percent of total percentages
Jim Dehner Apr 10, 2018 5:00 AM (in response to Karan Kumar)1 of 1 people found this helpfulHi
sorry but when you don't show us your twbx workbook we just have to assume what you need
because you are using table calculations you will need to nest the difference calculation and the % of total
start with the table calculation for the % of tota
the create a second calculation for the difference
Open the difference calculation and set the inner calculation (% of total) as shown
then open it again and set the outer calculation as shown
it will return this
Jim

6. Re: How to calculate difference between percent of total percentages
Karan Kumar Apr 10, 2018 11:12 PM (in response to Jim Dehner)Thank you so much Jim. It worked for me.
Karan

7. Re: How to calculate difference between percent of total percentages
Jim Dehner Apr 11, 2018 4:20 AM (in response to Karan Kumar)Thanks
Glad to help out
Jim