In this post I’d like to shine a spotlight on Tableau’s “hide data” feature. It’s a hidden gem 🙂 and deserves a shout-out. This feature works beautifully when using Quick Table Calculations such as Percent Difference. Let’s take a closer look.
In this example, the goal is to show monthly sales for the last three months and the % change month-over-month. To do this, bring the Sales and Date fields into the view and use a continuous date filter to show only the three months desired.
Next, bring a duplicate of Sales into the view and add the Quick Table Calculation for Percent Difference…but notice it is only showing the % change for the last two months, and not the first month in our view. Why? The view doesn’t have any data in the month prior to reference in the table calculation. Here’s where the fun begins.
Instead of using a continuous date filter, write a calculation that shows only the last three months, and place it on the rows shelf. This returns False for all months prior to the last three months, and True for the last three months.
Next, we need to Hide the False rows. To do this, right-click (control-click on Mac) on the word False in any row and use the menu to select Hide. This tells Tableau to keep the data in the view but hide it from the visual.
Once we’ve completed this step, our view now shows the Percent Difference for ALL three months.
Finally, we don’t need to show the date filter calculation on rows, so we can uncheck Show Header by accessing the dropdown menu on the blue pill.
Presto! We’ve accomplished our goal to show only the last three months of sales, and the % change month-over-month for all three months.
If you’d like to download the workbook, click on this link to access it on my Tableau Public profile page. Happy Vizzing!
Leave a Reply