Jay
Jay

Reputation: 465

Tableau: Single Value Filter but "All" option shows all elements summed instead of each value

I have a line chart with EmployeeName, Sales($), and Day.

I have a single value filter for each EmployeeName which works as it should.

Within that filter is a tableau generated option labeled (All), which then shows a line graph for each EmployeeName. So if there are currently 20 Employees, there are 20 line graphs stacked on top of each other.

Is there a way to change that so when (All) is selected, it will just display 1 line of all of the Sales($) summed up by Day.

Only solution I've found was to:

1. Duplicate sheet
2. Remove EmployeeName pill on row shelf to just sum company sales for each day
3. Sheet Swap based on a parameter value.

Is there a simplier solution? Help appreciated.

Upvotes: 1

Views: 3816

Answers (1)

Bernardo
Bernardo

Reputation: 3348

You can do it with one sheet but you still need a parameter. I used Superstore in this example to show sales by region and total sales if All selected.

1) Create a parameter for Region but add in a "(All)" value as well. 2) Create a filter to mimic a quick filter on Region.

if [Region Param] = "(All)" then "keep"
elseif [Region]=[Region Param] then "keep"
else "filter" end

select the Keep value.

3) Create a new Sum of Sales calc.

if [Region Param] = "(All)" then total(SUM([Sales]))
else SUM([Sales]) end

Using the Total function will create a table calc. I placed Year on Columns and Sum of sales on Rows. Adjust the Table Calc so it is compute using Region.

Now display the Region param and it will show each region or all regions summed if All is selected.

See workbook here: https://dl.dropboxusercontent.com/u/60455118/160521%20stack%20question.twbx

Upvotes: 1

Related Questions