7 Replies Latest reply on Aug 24, 2017 5:03 AM by pavan hm

# Show grand total for top N customers

Hi,

what if someone asks "How much profit do we make with our top 5 customers?" and you want to have an easy viz giving the answer?

E.g. in superstore I create this:

Showing the top 5 customers (ranked) by profit. As you can see, the Grand total still shows the unfiltered value for all customers. Is there an easy way to only show the value of those top N people, so their sum?

I'm using Tableau 10.3 and this is not specific to any dataset, so I just built it using the sample. I know it is related to the fact that totals are calculated before table calculations (like rank) in the order of operations.

Do you have an idea?

Best,
Torben

• ###### 1. Re: Show grand total for top N customers

Hi Torben,

Instead of Measure as filter, you can set dimension filter with parameter.

Also, don't forget to change other filters to context (gray color)

Thanks,

Shin

<< Ambassador Spotlight Here ! >>

1 of 1 people found this helpful
• ###### 2. Re: Show grand total for top N customers

Hi,

An alternate way would be drag and drop customer name to the filters shelf. From the pop-up select the Top tab and specify

This gives you top 5 customers and you get correct grand total.

Hope this makes sense.

~ Tushar

1 of 1 people found this helpful
• ###### 3. Re: Show grand total for top N customers

I did similar to the other two examples, but filtered top-10 on sum sales.  V8.2 example attached.

By getting the table calc out of there, you can make it easier on yourself.

In the attached. Sheet 5 grabs the top-10.  Sheet 7 sorts it.  Sheet 8 uses the TOP tab to incorporate a parameter to let your user select how many TOP he wants to see.

1 of 1 people found this helpful
• ###### 4. Re: Show grand total for top N customers

Hi everyone,

The next stage now would be to get an answer to the question "How much money do we make with our products in the top 2 regions they sell in?".

The viz for that could look like this:

So we have a filter on SUM(Sales) calculated on Table(horizontal). Here, the Grand Total again shows the total overall and not only for the filtered values. The way I understand it, this can't be solved with the "Top" filter (with or without parameters). Is that right?

Best,
Torben

• ###### 5. Re: Show grand total for top N customers

Is this what you are looking for? Let me know .

Thanks,

Pavan

• ###### 6. Re: Show grand total for top N customers

Hi Pavan,

this looks like the results are right, can you share how you specified the filters and the column variables?

Best,

Torben

• ###### 7. Re: Show grand total for top N customers

Hi Torben,

I m attaching the twbx . let me know if it serves your purpose.

Thanks,

Pavan