<< Back

Tableau Date Parameters (what are they good for?)

I’m on a personal quest at the moment to find cool things about functions of Tableau that I might not use as much as others. Date parameters are just one example. I know that they exist, I kind of know what I can use them for, but maybe I don’t often get chance to use them, or use an alternative to them (date quick filters anyone?).

In this post I’m going to show you four uses for date parameters. Then I’ll let you decide what they’re good for.

Creating Start and End Date Filters across Multiple Data Sources

In this scenario we have two data sources both with different date fields. We want to display charts from both data sources on one dashboard. If we use a quick filter on date we would have to display two date filters on our dashboard – one for each data source. However, by using the date parameter option we could have one control for both chart types. Here’s how it’s done:

I’ve connected up to both the Superstore Sales subset and the Coffee Chain sources. Then we create two parameters: one for start date; one for end date. Use the images below as a guide:

start date
Start Date
end date
end date

Then we use these parameters in a calculated field based on our date:


date filter

This creates a boolean true or false. Place this on the filter shelf and select ‘true’ to display only dates within the start and end date parameter selections.


date filter is true

Replicate this in the Coffee Chain data source replacing Order Date with Date. I created sales over time for each data source.

date filter results

Now if we place these on to a dashboard we only need to show the start and end date parameter controls and both charts will change.


sales dashboard

Using Date Parameters within Calculations

You can also use the start and end date parameters within calculated fields. This can be useful if you don’t want to add the true/false filter we created on to the filter shelf. But instead want to do the filtering within the calculation.


date parameter calc

This calculation will now give you the sales for records within the start and end date. You haven’t got the start and end date on the filter shelf, so if you still wanted to display Sales for the entire dataset, you could do.

date calc example

Dynamic Date Axis on a chart using Date Parameters

Here’s an interesting query I was given recently: If my date ranger is greater than one year, then I want my date axis to be quarterly. However, if my date range is less than one year then I want the axis to show months. Here’s how I did it:

Created a calculated field using some nifty date functions DATEDIFF() and DATETRUNC().

axis date

Now if I set my parameter start date and end date to longer than 12 months my date parts are quarters:



And if I set it to less than 12 months apart we get months:

monthly dates

You could potentially go even further and go down to smaller levels: if the date difference is less than a month, show week;less than a week, show days. The only thing you have to do is make sure that the date part of the pill in the view is set to the LOWEST date level you are using (months for months, weeks for weeks etc).

Using Date Parameters in Custom SQL:

Here’s another use for our start and end date parameters. Say I only want to bring back data within my start and end dates. Well then we can use our date parameters in Tableau’s custom SQL connection:

custom sql

Now, if our start or end date parameters change, so will our data.

custom sql final

I’m sure there are many other great uses for date parameters out there. If you have used any, feel free to leave a comment below. We love hearing about cool things you’ve done with Tableau.

Download the workbook with all the examples.

Emma Whyte

London, UK

7 thoughts on “Tableau Date Parameters (what are they good for?)

  1. emma:

    nice, insightful post. i found it while researching a particularly devilish problem with which i’m wrestling (http://preview.tinyurl.com/kucp56o). any chance you’ve hit on a way to calculate — and display — a sum across an entire region/category, when using individual parameters to calculate sums in a variety of sub-regions/categories within the main? i’m using tableau public, and the support team at tableau hasn’t (yet) found a solution.


  2. Awesome post.. Thank you!!

    Could you please explain how do I create a Table based on Hire Date and Termination date without using SQL. I have below fields available.

    1. Associate #
    2. Associate Name
    3. Hire Date
    4. Termination Date

    Based on the above fields I wanted to show in a Single chart

    1. How Many people Joined Year/Month (Bar)
    2. How Many resigned Year/Month (Bar)
    3. Total Active Headcount as on Date. (Bar)
    4. Attrition % (A line Chart on other Axis).

    Thanks in Advance.

    1. Hi Syed – apologies for the delay on responding to this question, I think you will get a faster response to a question like this in the Tableau Community Forum, if you post their then feel free to post a link here and we’ll take a look.


  3. We are currently facing the challenge in Tableau Report. The data is fetched from Salesforce.

    Please find the below problem statement . Please let me know if you need more information regarding the same.

    Problem statement:
    We have an requirement to display the data as month basis – where data has to be distributed equally from start date to end date.

    For example start date is 1/Jan/2015 and End Date is 31/Jan/2016 then over the period for every month data has to be distributed across the months between 1/Jan/2015 and 31/Jan/2016.

    Key Points:

    In tableau we need to display the 12 months representation from the current month in x-axis. So we have taken Sheet named Months as the primary source, which will have static months list from current month to next twelve months. This would not be the correct way. But to achieve 12 months in x-axis we have taken this excel sheet.

    Kindly provide some idea/solution how can we achieve the same in tableau.

    1. Hi Poornima! These kind of questions are difficult to sort out in comments, I’d recommend you post to the Tableau Community and then post the link here so we can look (assuming the community doesn’t get there first)

  4. Hello Everyone,

    I have used Custom SQL with UNION all to only required Column’s from 3 tables. with few conditions in Custom SQL & DATE PARAMETER.

    Problem Statement.
    Now i have to create Extract with Refresh schedule.
    – Everyday data is appended
    – Customer can choose any date in last 2 years(now we have only 8 months data)
    – I’m stuck in creating extract or refreshing extract (In server it shows only for one date data, as Parameter is not auto update)

    Need your help.

  5. How do I calculate total count of ‘Sunday’ , ‘Monday’ , … etc between the two dates selected?

    Start Date = 1/1/2016
    End Date = 1/26/2016

Leave a Reply

Your email address will not be published. Required fields are marked *