hk2
hk2

Reputation: 487

Display values in the dashboard title based on filter selection in Tableau

I have a list of product names with some values tied to them. These product names are also applied as filter. Let's say these products are named as Prod A, Prod B, Prod C, Prod D, and Prod E. My goal is to display the product names which are selected in the filter as dashboard title, but the twist is that Prod C and Prod D together describe a new product called 'Personalized Product', which means if Prod C and Prod D are selected from the filter, the dashboard title should display Personalized Product whereas if only Prod C is selected in the filter, the title should be displayed as Prod C. Similarly, the other product names should be displayed in the title when selected individually from the filter. Is it possible to achieve this without using a parameter?

I have attached a sample workbook for reference in the link below with what I have done so far. https://drive.google.com/file/d/1w9aZTqw3ndo87HxUVwcP1lbj4yHW3hSZ/view?usp=sharing

Thanks!

Upvotes: 0

Views: 1038

Answers (1)

Keshia Rose
Keshia Rose

Reputation: 191

One way to do this would be with an LOD calc and a context filter. You can create an LOD calculation a the Product Group level that determines how many products within that group are being shown. If it is more than 1, then show the group name, otherwise, show the product name. Next, use this instead of Product Name on your worksheets and add the Product Name filter to context. This way the calculation will only look at data that is currently on the worksheet when computing. Here is a calculation that would work:

{FIXED [Product Name (group)]:
  IF COUNTD([Product Name]) > 1 THEN MIN([Product Name (group)])
  ELSE MIN([Product Name])
  END
}

Then if you want to showcase the selected products you can use a worksheet that lists out the products in place of the actual dashboard title. You can do this simply by just putting the calculation on text on a blank worksheet. Or, you can go a little nicer with a calculation to display them with punctuation like this:

PREVIOUS_VALUE("") +
IF FIRST() = 0 THEN ""
ELSEIF LAST() = 0 THEN " & "
ELSE ", " END
+ MIN([Group Calc])

And then add a filter for LAST() = 0 to keep just the last row: Here's what the setup looks like: enter image description here Add the LAST() = 0 filter and hide lines and headers: enter image description here All together: enter image description here

Upvotes: 0

Related Questions