May
May

Reputation: 29

Tableau filter a dimension without affecting table grand total

I have faculty performance evaluation data at my school, organized by department. Some faculty are not affiliated with any dept, i.e., their dept field is missing (null value). I created a dept filter and wanted to achieve two similar goals:

  1. filter out faculty who are null dept in view but include them in calculating school average
  2. select any dept from the dept filter without changing the school average.

In the end, I want to show all depts in view, with dept filter on the side, and readers decide which depts to include in the view, but regardless of how many depts are chosen the grand total/school average stays the same.

Here is the sample workbook. This is a common problem for a majority of my workbooks.

Upvotes: 1

Views: 3782

Answers (2)

May
May

Reputation: 29

Someone from the Tableau forum helped figure out this question. Create a calculated field for dept filter, using the code: lookup(min([Dept]),0). Use this filter to let users select dept. The grand total stays the same.

https://community.tableau.com/message/596484#596484

Upvotes: 0

Alex Blakemore
Alex Blakemore

Reputation: 11896

For step 1), right click on the Null Dept in your first column, and choose Hide. The data is still included, just not displayed, so it won't change the Grand Total.

For step 2), it will take more than one mouse click, but can be done by combining a few features. If you only want to show one Department at a time, and your Department's don't change, then

  1. Create a parameter to select the department to show
  2. Create a calculated field or a set to denote which department to show
  3. Place that field on the row shelf and use it to hide other departments

LOD calculations are also very useful for these kinds of problems.

Upvotes: 0

Related Questions