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.
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
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
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 Sasha. Please see my other post for the issue I am facing with this approach.
1 of 1 people found this helpful
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
Thank you so much Jim. It worked for me.
Glad to help out