How to Build a Custom Date Filter for a Tableau Dashboard

By: Eric Parker

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can also sign up for a Tableau Office Hour to work with him directly!

Sometimes, you need a totally customized date filter for a Tableau dashboard. A fully customized date filter allows you to list the exact date ranges you want a user to be able to select from, and then filters the worksheets in the dashboard to that selected range. Check this video out to learn how you can utilize a parameter, calculation with date logic and worksheet filters to give your users a fully customized list of date ranges they can select and filter on.

You can download the Tableau workbook from the video on Tableau Public here.

Here is the full calculation from the [Parameter Date Filter] field:

CASE [Date Filter]

WHEN 1 THEN YEAR([Date]) = YEAR(TODAY())

WHEN 2 THEN (YEAR([Date]) = YEAR(TODAY()) - 1) AND DATEPART('dayofyear',[Date]) <= DATEPART('dayofyear',TODAY())

WHEN 3 THEN (YEAR([Date]) = YEAR(TODAY()) - 1)

WHEN 4 THEN DATEDIFF('month',[Date],TODAY()) = 0

WHEN 5 THEN (DATEDIFF('month',[Date],TODAY()) = 1) AND DAY([Date]) <= DAY(TODAY())

WHEN 6 THEN DATEDIFF('month',[Date],TODAY()) = 1

END

Want to keep up with the latest Tableau trends? Subscribe to our YouTube channel and join us for one of our upcoming events!

Tableau Bar in Bar Chart Options

How (& Why) To Build a Diverging Bar Chart in Tableau

0