MIP Logo

Tableau – Highlight Selected Lines Using Sets

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

A line chart is useful to show trends over time, however, it may clutter the chart when there are multiple lines to represent categories. A set can be used to highlight only selected lines and gray out lines that are unselected by the user. I will be using a dataset on drug prices to illustrate this.

2.    Below are the steps:

2.1  Create a set for the category, e.g. country. Select a few countries.

2.2  Right click on the set created and ‘Show Set.

2.3  On the marks panels, add set dimension into ‘color’. In addition, add the category to ‘color’. Ensure that the color palette are set to different colors for those that are in the set. Colors for countries that are out of the set would be set to gray.

2.4  The final line chart will look as shown below. Select multiple countries on the filter panel. The selected countries are highlighted in color, while the unselected ones would be grayed out.

3.        Thanks for reading my post. You can also view the Tableau dashboard posted here.

Share this post