Rooney
Rooney

Reputation: 1

How to default highest version filter in tableau dashboard?

I am trying to build a dashboard which displays record count by product, category and versions. One product can have multiple versions and one version will have multiple categories. I want to build this dashboard by defaulting it to show the record count by category for the highest version of the selected product whenever any user opens the Tableau dashboard. How do I set my filter so that initially, the dashboard only displays record count for the highest version for each category for the selected product?

I tried using max version for each product and use that as a filter but when I change the product filter, the dashboard becomes blank as the selected max version is not applicable for this next product.

Data:

Product Versions Category Count
P1 1 C1 15
P1 1 C3 20
P1 1 C4 150
P1 1 C5 200
P1 2 C1 60
P1 2 C3 50
P1 2 C4 10
P1 2 C5 25
P2 8 C1 1500
P2 8 C3 2001
P2 8 C4 1505
P2 8 C5 250
P2 12 C1 600
P2 12 C3 550
P2 12 C4 160
P2 12 C5 258

I expect the output when the user opens the dashboard as:

Filter selection: Product: P2

Category Version Count
C1 12 600
C3 12 550
C4 12 160
C5 12 258

Filter selection: Product: P1

Category Version Count
C1 2 60
C3 2 50
C4 2 10
C5 2 25

Upvotes: 0

Views: 172

Answers (1)

hampus
hampus

Reputation: 16

There are multiple ways of solving this. One would be to change the product filter to a context filter and keep using the MAX function as the aggregation of the variable count. You do this by right-clicking the filter pill and select "Add to context" This way the product filters out first and the Version filter is applied afterward.

This is probably the simplest in regards that it does not involve creating calculated fields and is just two clicks away.

You can read more about the order of operations here if you want to know more.

Upvotes: 0

Related Questions