BI & Analytics
Blog
Tableau
5
min read

Parameters vs Filters in Tableau:

Learn the difference between parameters and filters in Tableau, and how to mask a parameter as a date filter to compare current and previous year data.
Author
Arend Verschueren
Arend Verschueren
Head of Marketing & RevOps
Parameters vs Filters in Tableau:
Share article

In Tableau, filters slice your data based on values that exist in the data source, while parameters are user-controlled inputs that can drive calculations, filters, and reference lines. The key difference is that parameters can be used inside calculated fields and filters cannot, which makes parameters the right choice whenever you want one selection to drive several visuals in different ways.

This guide walks through the differences and shows you how to use a parameter as a date filter to compare current and previous year data on the same dashboard.

Parameter vs filter in Tableau: what's the difference?

A filter restricts the data shown in a worksheet to a subset of values that exist in your data source. A parameter is a workbook-level variable (a number, date, string, or boolean) whose value the user controls, and that you can plug into calculations, filters, reference lines, and titles.

Here is how they compare side by side:

Parameters vs filters in Tableau comparison table

Filters can work across data sources using data blending, but blending has its own limitations.

The bottom row of that table is the one that matters most for this tutorial. Because parameters can be used inside calculated fields, they let you do things a filter alone cannot, like driving two visuals in two different ways from the same user input.

When should you use a parameter instead of a filter?

A filter is usually the right tool. Reach for a parameter when you hit one of these situations:

  • You want one selection to drive multiple visuals in different ways. For example, picking "March 2024" should show this March's sales on one chart and last March's sales on another. A filter would hide last March from both.
  • You need to filter across data sources without using data blending.
  • You want to swap measures, dimensions, or sort orders based on user input (a parameter inside a calculated field).
  • You need a "what if" input for a reference line, scenario modelling, or threshold check.

The use case we are about to build falls into the first category. We want a single date picker that drives one visual showing this period's data and another showing the same period last year.

What we're looking for should look like this:

when to use paramaters instead of filters

How to use a parameter as a date filter in Tableau

Here is the full 5-step build. We will use the Sample Superstore dataset, but the technique works on any data source with a date field.

Step 1: Create the date parameter

Create the date parameter in Tableau

Right-click in the Data pane and select Create Parameter. Configure it as follows:

  • Name: p.Date Selector
  • Data type: Date
  • Allowable values: Range
  • Set from field: Order Date (this pulls the min and max dates from your data so the parameter knows the available range)
  • When workbook opens: Tick this so the parameter dynamically updates whenever the workbook is refreshed

Setting the data type to Date is important. Keeping the parameter as a true Date (rather than a string of date values) gives you cleaner performance and access to all of Tableau's date functions later.

Step 2: Create a calculated field to mask the parameter as a filter

create a calculated field in tableau

This is where the magic happens. We are going to write a calculated field that returns TRUE when a row's date matches the parameter, and FALSE otherwise. Putting that field on the Filters shelf and setting it to TRUE turns the parameter into a working filter.

Create a calculated field called Filter: Current Period:

DATETRUNC('month', [Order Date]) = DATETRUNC('month', [p.Date Selector])

DATETRUNC('month', ...) rounds both dates down to the first of the month, so any order placed in the same month as the parameter selection returns TRUE.

If you want a day-level filter instead, drop the DATETRUNC and compare the raw dates:

[Order Date] = [p.Date Selector]

Step 3: Apply the filter to your current-period worksheet

Build the worksheet that should show current-period data (for example, a bar chart of sales by sub-category for the selected month). Then drag the Filter: Current Period calculated field onto the Filters shelf and select True.

Right-click the parameter in the Data pane and choose Show Parameter to make the date picker visible on the worksheet.

Test it. Change the parameter value and the worksheet should refilter to show only the data for the selected month. Functionally this is no different from a normal date filter so far, but the next step is where parameters earn their keep.

Step 4: Duplicate the calculation with DATEADD for the previous-period worksheet

duplicate the calculation using dateadd

Now build the second worksheet, the one that should show the same period last year. Create a new calculated field called Filter: Previous Year:

DATETRUNC('month', [Order Date]) = DATETRUNC('month', DATEADD('year', -1, [p.Date Selector]))

The DATEADD('year', -1, ...) shifts the parameter selection back one year before the comparison runs. So when the user picks March 2024, this calculation returns TRUE for any order placed in March 2023.

Drag Filter: Previous Year onto the Filters shelf of the previous-year worksheet and set it to True.

Rinse and repeat for the day-level visuals.

parameter for day-level visuals
Previous year day filter using parameters

Now you have two visuals on the same dashboard, both driven by one date picker, each showing a different time period. A standard filter cannot do this because a filter removes the prior year's rows from the data entirely.

You can extend this pattern to any time comparison: previous month, same week last year, two years ago, fiscal-year-to-date. Just change the DATEADD interval. For finer-grained control, our guide to parameter actions shows how to drive the parameter from clicks on the dashboard rather than a dropdown.

filters vs parameters end result

Step 5: Add a dynamic title that updates with the parameter

adding a dynamic title

A small finishing touch that makes the dashboard look professional: have the chart titles include the selected date.

  1. Create a calculated field that contains only the parameter: Title Date = [p.Date Selector].
  2. Drag this calculated field onto the Detail mark of the worksheet.
  3. Double-click the worksheet title to edit it.
  4. From the Insert menu in the title editor, choose your Title Date field.

Now the title will read something like "Sales for March 2024" and update automatically when the user changes the parameter. For more title-customisation techniques, see our guide on how to personalise your Tableau dashboards with custom titles.

Common issues and how to fix them

Problem: The filter returns no data, even though the parameter is set to a valid date.

Fix: Check the data type of your parameter. If it is set to String instead of Date, the DATETRUNC comparison will fail silently. Edit the parameter and set the data type to Date.

Problem: The parameter dropdown shows old dates that are no longer in the data.

Fix: Open the parameter and tick Set from field > Order Date with the When workbook opens option enabled. This makes the parameter refresh its min/max range each time the workbook loads. Without this, the parameter is stuck with whatever range existed when you first created it.

Problem: The previous-year worksheet is empty for the most recent month.

Fix: Your data does not contain orders from one year ago for that month. This is common with truncated datasets like Sample Superstore. Pick a date earlier in the range to confirm the calculation is working, then check your real data for coverage.

Problem: The dynamic title displays the raw parameter value like "3/1/2024 12:00:00 AM" instead of "March 2024."

Fix: Right-click the Title Date calculated field in the Data pane, choose Default Properties > Date Format, and select a cleaner format like "March 2024" (mmmm yyyy).

Problem: Changing the parameter does not update the visuals.

Fix: Make sure the Filter: Current Period and Filter: Previous Year calculated fields are on the Filters shelf and set to True. If they are on Rows, Columns, or another shelf, they will not filter the view.

Frequently Asked Questions

What is the difference between a parameter and a filter in Tableau?

A filter restricts the data shown in a worksheet to values that exist in the data source and cannot be used in calculations. A parameter is a workbook-level user input (a number, date, string, or boolean) that can be plugged into calculations, filters, reference lines, and titles. Parameters work across multiple data sources; filters are tied to one.

Can a parameter act as a filter in Tableau?

Yes. Create a calculated field that compares the parameter to a field in your data (for example, [Order Date] = [p.Date Selector]), drag the calculated field onto the Filters shelf, and set it to True. The parameter now behaves like a filter, but with the added flexibility that you can also reference it inside other calculations.

Why use a parameter instead of a filter for date comparisons?

Because a standard filter removes the rows it filters out. If the user selects March 2024 and you want to also show March 2023 on another chart, a filter has already deleted March 2023 from the data. A parameter does not delete anything, so you can use it inside a DATEADD calculation to drive a second worksheet showing the prior year.

Can I make a Tableau parameter multi-select?

Not directly. Parameters are single-select by design. If you need multi-select behaviour, you can simulate it with a multiple select parameters workaround that uses a set or a string-based parameter with conditional logic. For true multi-select, use a standard filter or a set action.

Conclusion

The "parameter or filter" question is one of the most common decisions in Tableau dashboard building, and the answer is usually the same: use a filter unless you need something a filter cannot do. The moment you need one input to drive multiple visuals differently, or you want to compare a current period to a prior one on the same dashboard, parameters become the obvious tool.

The masked-parameter-as-filter pattern in this guide is a workhorse technique. Once you have built it once, you will reach for it constantly for year-over-year comparisons, prior-month dashboards, and any other "same selection, different time window" view.

If you want help applying these patterns to a real dashboard, get in touch with the Biztory team and we will help you build it.

Facts & figures

About client

Testimonial

Blogs you might also like

How to Use a Custom Background Image in Tableau
Arrow icon darkArrow icon dark

How to Use a Custom Background Image in Tableau

Learn how to use a custom background image in Tableau to plot data on floor plans, diagrams, or any image. Step-by-step tutorial with coordinates.

BI & Analytics
Blog
Tableau
How to Create an Interactive Calendar in Tableau
Arrow icon darkArrow icon dark

How to Create an Interactive Calendar in Tableau

Learn how to create an interactive calendar in Tableau in 4 steps using a date scaffold and Set Actions. Step-by-step tutorial with calculations.

BI & Analytics
Blog
Tableau
How to sheet swap in Tableau in just 5 steps
Arrow icon darkArrow icon dark

How to sheet swap in Tableau in just 5 steps

Learn how to sheet swap in Tableau in 5 steps. Dynamically show/hide worksheets using parameters, save dashboard space, and fix common issues.

BI & Analytics
Blog
Tableau
Tableau Custom Number Formatting
Arrow icon darkArrow icon dark

Tableau Custom Number Formatting

Master Tableau custom number formatting with copy-paste examples. Learn the syntax for positive, negative & zero values.

BI & Analytics
Blog
Tableau
Introducing Autom8: Automated workflows from within Tableau
Arrow icon darkArrow icon dark

Introducing Autom8: Automated workflows from within Tableau

Autom8 is here. Trigger workflows, sync data, and act on insights — all without ever leaving your dashboard.

BI & Analytics
Blog
Autom8
Tableau's order of operations
Arrow icon darkArrow icon dark

Tableau's order of operations

Learn more about Tableau's order of operations: or what happens when and how. Read the full blog here.

BI & Analytics
Blog
Tableau
Tableau Next features: the complete guide
Arrow icon darkArrow icon dark

Tableau Next features: the complete guide

Learn about the different features in Tableau Next and how they drive faster decision-making.

BI & Analytics
Blog
Tableau
5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions
Arrow icon darkArrow icon dark

5 Ways to Level Up Your Bar Chart Using Tableau Parameter Actions

Tableau Parameter Actions are a great feature in Tableau. Read all about it in our latest blog.

BI & Analytics
Blog
Tableau
Everything you need to know about Tableau Certifications
Arrow icon darkArrow icon dark

Everything you need to know about Tableau Certifications

Thinking of taking one of the Tableau Certifications? We explore how to get ready in our latest blog. Read all about it here.

BI & Analytics
Blog
Tableau
Personalise your Tableau Dashboard with Custom Titles
Arrow icon darkArrow icon dark

Personalise your Tableau Dashboard with Custom Titles

Learn about how to add the personal touch to your Tableau Dashboard with custom titles.

BI & Analytics
Blog
Tableau
Bar Charts: The Good, the Bad, and the Ugly
Arrow icon darkArrow icon dark

Bar Charts: The Good, the Bad, and the Ugly

Why can bar charts be effective and how to use them to get answers easier, and faster!

BI & Analytics
Blog
Tableau
How to create a waterfall chart in Tableau
Arrow icon darkArrow icon dark

How to create a waterfall chart in Tableau

Learn how to create your own waterfall charts in Tableau Desktop by following these steps.

BI & Analytics
Blog
Tableau
The Ultimate Guide to Embedded Analytics
Arrow icon darkArrow icon dark

The Ultimate Guide to Embedded Analytics

Discover what embedded analytics is all about and how it can drive additional revenue streams for your business.

BI & Analytics
Blog
ThoughtSpot
How to label pie charts in Tableau
Arrow icon darkArrow icon dark

How to label pie charts in Tableau

Learn more on how to label pie charts in Tableau like a pro.

BI & Analytics
Blog
Tableau
How to label bar charts in Tableau
Arrow icon darkArrow icon dark

How to label bar charts in Tableau

Learn how to label bar charts in Tableau like a pro and level up your dashboard design. Read the full article here.

BI & Analytics
Blog
Tableau
How to create a donut chart in Tableau
Arrow icon darkArrow icon dark

How to create a donut chart in Tableau

Looking to create a donut chart in Tableau? Read our in-depth guide on how to level up your donut charts in Tableau here.

BI & Analytics
Blog
Tableau
How to ace your ThoughtSpot certifications?
Arrow icon darkArrow icon dark

How to ace your ThoughtSpot certifications?

Learn more about ThoughtSpot certifications and how to ace your exams.

BI & Analytics
Blog
ThoughtSpot
How to stop marks being highlighted when ‘clicked’ in Tableau
Arrow icon darkArrow icon dark

How to stop marks being highlighted when ‘clicked’ in Tableau

Learn how to stop marks from being highlighted when clicked in Tableau.

BI & Analytics
Blog
Tableau
How to Create Multiple Select Parameters in Tableau
Arrow icon darkArrow icon dark

How to Create Multiple Select Parameters in Tableau

Learn how to create multiple select parameters in Tableau to add more control and interactivity to your analysis.

BI & Analytics
Blog
Tableau
How to apply conditional formatting to tooltips in Tableau
Arrow icon darkArrow icon dark

How to apply conditional formatting to tooltips in Tableau

Learn how to apply conditional formatting to tooltips in Tableau with our step-by-step guide. Improve your data visualization skills today with Biztory.

BI & Analytics
Blog
Tableau
Rediscovering Business Intelligence with Sigma Computing
Arrow icon darkArrow icon dark

Rediscovering Business Intelligence with Sigma Computing

Discover how Sigma Computing is reshaping the BI landscape with its user-friendly interface and powerful capabilities.

BI & Analytics
Blog
Sigma
Sigma Computing: Our Favourite Features
Arrow icon darkArrow icon dark

Sigma Computing: Our Favourite Features

Discover our favourite features of Sigma for powerful and fun data analysis.

BI & Analytics
Blog
Sigma
Tableau vs. Power BI: Everything to know
Arrow icon darkArrow icon dark

Tableau vs. Power BI: Everything to know

Compare Tableau and Power BI to determine the best business intelligence tool for your needs.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Getting Started (1/3)
Arrow icon darkArrow icon dark

Tableau Map Layers: Getting Started (1/3)

Learn how to leverage Tableau's Map Layers feature to create complex visualizations.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Pull everything into one view (3/3)
Arrow icon darkArrow icon dark

Tableau Map Layers: Pull everything into one view (3/3)

Use Tableau Map Layers to combine multiple visuals in a single worksheet and create custom dashboard views for enhanced data visualization.

BI & Analytics
Blog
Tableau
Tableau Map Layers: Building Different Charts (2/3)
Arrow icon darkArrow icon dark

Tableau Map Layers: Building Different Charts (2/3)

Learn how to create Pie, Doughnut, Line, and Area charts using Tableau Map Layers.

BI & Analytics
Blog
Tableau