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]))
END)
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])
END)
//Category Count
{COUNTD([Category])}=1
GO FORTH AND VIZ!