5 Replies Latest reply on Jan 26, 2014 1:37 PM by Eric Lopez

# Issue in displaying percentage of total along with Top N

Hello,

I have a scenario where i have a supplier and a related <measure> say [sum(Value_US)].

I have to show the top 10 suppliers based on the <measure>. This is simple. I apply a filter for supplier and use the Top 10 by <measure> option. This is working fine.

I have to show another measure [sum (Value_US) / total (Value_US)] which is Percentage of total of the <measure>.

When there is no condition applied for Top 10, this works as expected.

When I apply condition for Top 10, Tableau calculates the percentage based on the Top 10 suppliers only. I want the the percentage to be calculated for all the suppliers present in the data. Can we do this in Tableau?

Attached is the sample packaged workbook.

Thanks,

• ###### 1. Re: Issue in displaying percentage of total along with Top N

When I apply condition for Top 10, Tableau calculates the percentage based on the Top 10 suppliers only. I want the the percentage to be calculated for all the suppliers present in the data

You can do this using Table calculation filter instead of Top 10 filter on Supplier dimension.

I have created and example using index() for top 10. please have a look

Adding a note that you have to sort the pane by Supplier Descending order on Value_Us to make sure the top 10 table calculation filter is accurate.

• ###### 2. Re: Issue in displaying percentage of total along with Top N

Indumon,

This works perfect. Thank you so much!

Regards,

• ###### 3. Re: Issue in displaying percentage of total along with Top N

Indumon,

How did you do this part?

Adding a note that you have to sort the pane by Supplier Descending order on Value_Us to make sure the top 10 table calculation filter is accurate.

Thank you

• ###### 4. Re: Issue in displaying percentage of total along with Top N

Alexis,

Right click on suppliers in rows ->sort then make the sort settings like below

• ###### 5. Re: Issue in displaying percentage of total along with Top N

This solution is awesome, however, now that I have the top 10 filtered how do I create a "Top 10 Subtotal" row that tallies up the dollars and percentages of the data that is now being filtered?  When I add Grand Total it gives the Total of all of the data, not just the Top 10. Help!