How to show nothing when “All” is selected in Tableau

When "All" doesn't make sense

click to view on Tableau Public

Tableau’s filter capabilities are an essential part of what makes Tableau special. But sometimes we don’t want anything to show when we remove a filter or show all dimensions. So how do you show nothing with “all” is selected in Tableau? This challenge from Emma Whyte back in week 2 of 2017 does just that.

Check out the video for my approach. Scroll down to see my calculations that used for the challenge.

The calculations

In order to get the last month for the dynamic title we need to evaluate each month and return the month only when it matches the maximum month in the view. 

//Recent Month Title
DATE(IF ATTR(DATETRUNC('month', [Order Date])) = TOTAL(MAX(DATETRUNC('month', [Order Date])))
THEN ATTR(DATETRUNC('month', [Order Date]))

Very similar to the above calculation, we’ll use the same logic statement but we’ll swap out the sum of sales for what the calculation returns when true

//Recent Month Sales
DATE(IF ATTR(DATETRUNC('month', [Order Date])) = TOTAL(MAX(DATETRUNC('month', [Order Date])))
THEN SUM([Sales])
In order to get nothing to show when we select the “All” option of the filter, we need to evaluate how many categories are in context after filter. This calculation will be added to our filter card and set to the specific dimension of TRUE. Additionally we’ll need to add our Category dimension filter to context.
//Category Count


Check out the interactive visualization below

Skip to content