Dynamically show and hide visuals in Tableau and Power BI

How many times have you been put off by the appearance of a noisy graph, as soon as you open a dashboard? While there are instances where a more complex approach could be required, sometimes the answer is as simple as: Don’t show it when it is cluttered! Here is one simple technique to dynamically hide a visual in both Tableau and Power BI.

Take the below dashboard for example, using Superstore data to show the user the sales by category over time. Since no categories are selected by default in the line chart, the several subcategories make the clustered bar chart representing profit appear crowded and difficult to gain any insight from at first glance.

Screenshot 2023-11-13 215053.png

However, a simple tweak to these visuals, to make the profit visual only appear once a category is selected could help make this dashboard much easier to read.

TABLEAU:

Step 1: Click on Dashboard → Actions on the menu bar and create a new sheet filter action.
Screenshot 2023-11-14 125616.png

Screenshot 2023-11-14 125744.png

 

  • Step 2: Edit the filter action.
  1. Change the name of your filter (Good practice)
  2. Select your source sheet. (This is the visual which on selection will cause the action)
  3. Choose ‘Select’ as we want this action to run when we click on the visual.
  4. Select the target sheet. (This is the visual that will appear and disappear based on selection)
  5. Choose ‘exclude all values’ as we want the target visual to disappear once the selection is cleared.
  6. In this example we want to filter only target the subcategories and not the date, hence we need to specify the columns which will filter by selection.

Your paragraph text.png

Press OK and you now have a dynamic visual appearing and disappearing based on a selection.

POWER BI:
  • Step 1: Create a summary table for sub-category. (This is required specifically for this used case as we need the category filter to work on subcategory but ignore the year-quarter selected)
    image.png

 

  • Step 2: Build a relationship between the new table and the base tableimage.png

 

  • Step 3: Create a measure on the original table which provides the value 1 when a single category is selected. image.png
  • Step 4: Add the measure as a filter to your Sub-category visual
    image.png
  • Step 5: Remove the background and border of the Sub-Category visual.

Just like that, we have the same result in Power Bi

 

 

The Data School
Author: The Data School