I'm not sure I understand the desired outcome. Do you want the grand total to be a sum of the top 5 products' percentages? Or do you want to only show one bar for the top 5 products and the grand total?
Thanks for your response. I want to customize grand total in such a way that it should show the sum of "Top 5 Products" if 5 is entered. I tried out doing it with adding a reference line such that it will show the sum of top N product percentages.