How to Get Today's Date in Tableau
Having the current date readily available on your Tableau dashboard isn't just a nice touch, it's essential for creating relevant, up-to-the-minute reports. It allows you to transform static charts into dynamic tools that reflect real-time performance, track progress toward goals, and give users immediate context. This article will show you exactly how to get today’s date in Tableau using the TODAY() function and unlock its power in your own visualizations.
What is the TODAY() Function in Tableau?
At its core, Tableau's TODAY() function is one of the simplest yet most powerful tools in your arsenal. It is a date function that returns the current system date of the computer where Tableau is running. For instance, if you use this function on October 26, 2023, it will return the date "2023-10-26".
The syntax couldn't be easier. It has no arguments, so you just type it as is:
TODAY()
It's important to distinguish TODAY() from its close relative, NOW(). While TODAY() returns only the date, NOW() returns the current date and time (e.g., "2023-10-26 10:30:45 AM"). For most business dashboards that analyze data on a daily basis - like daily sales, weekly traffic, or monthly performance - TODAY() is the right choice. It simplifies comparisons and prevents unexpected issues that can crop up when dealing with timestamps. We’ll discuss this difference in more detail later on.
How to Create a "Today's Date" Calculated Field
Before you can use the TODAY() function, you need to add it to your Tableau workbook as a calculated field. This creates a reusable data item that you can drag and drop into your views, use in other calculations, or apply as a filter. The process is straightforward.
Follow these quick steps:
- From the Data pane, click the drop-down arrow at the top right and select "Create Calculated Field...".
- A new window will open. In the title box at the top, name your field something intuitive, like "Current Date" or "Today's Date".
- In the main formula box, type
TODAY(). You’ll notice Tableau’s formula helper confirms it’s a valid function. - Click "OK" to save the calculated field.
That's it! You'll now see your newly created "Today's Date" field in the Data pane, usually at the bottom of your fields list under the "Measures" or "Dimensions" section. You can now use this dynamic field across your entire workbook.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Practical Use Cases for TODAY() in Tableau Dashboards
Creating the calculated field is just the first step. The real magic happens when you use it to make your dashboards more intelligent and valuable. Here are some of the most common and effective ways to use the TODAY() function.
1. Displaying the Current Date on Your Dashboard
A simple but effective starting point is to prominently display the current date on your dashboard. This instantly tells your audience the context of the data and when it was last updated or viewed, which is especially useful for reports that are printed or shared as PDFs.
How to do it:
- Create a new worksheet in your workbook. Call it "Date Display" or something similar.
- Drag your "Today's Date" calculated field onto the Text mark on the Marks card.
- By default, Tableau might show the full date hierarchy (YEAR, QUARTER, etc.). Right-click the field and select the "Exact Date" option and also set it to "Discrete." This will ensure it displays as a single, readable date. You can also format it further by right-clicking the field and choosing "Format..."
- Now, on your main dashboard, drag this "Date Display" worksheet to where you want the date to appear, perhaps in the top right corner. You can hide the worksheet title and format it to blend in seamlessly.
A pro tip is to directly add it to a title. Add your "Today's Date" field to the Detail part of the Marks card in any worksheet, then edit that worksheet's title and use the "Insert" menu to add your calculated field.
2. Calculating "Days Since" or "Age" Dynamically
TODAY() is incredibly useful for calculating durations against the current date. For example, you can calculate an employee's tenure, a customer's age, a product's lifecycle stage, or the number of days a support ticket has been open.
To do this, you'll combine TODAY() with another powerful date function: DATEDIFF().
The DATEDIFF() function calculates the difference between two dates. Its structure is:
DATEDIFF('date_part', [start_date], [end_date])
Example: Calculate employee tenure in years
Let's say you have an [Hire Date] field. You can create a calculated field named "Employee Tenure (Years)" with this formula:
DATEDIFF('year', [Hire Date], TODAY())
Every time the dashboard is refreshed, this field will automatically recalculate the tenure for every employee based on the current date.
3. Filtering for Year-to-Date (YTD) Performance
Analyzing year-to-date performance is fundamental for almost any business. TODAY() allows you to create a dynamic YTD filter that automatically includes all relevant data from the beginning of the current year up to the day you're viewing the dashboard. No more manually updating date filters every month!
To create a YTD filter, create a new calculated field that works as a boolean (True/False) flag:
Example: Creating a YTD Sales Filter
Assuming you have a transaction date field called [Order Date], you can create a calculated field named "Is YTD?" with the following formula:
[Order Date] <= TODAY() AND YEAR([Order Date]) = YEAR(TODAY())
Let's break down this logic:
[Order Date] <= TODAY(): This ensures you don't include data from future dates.YEAR([Order Date]) = YEAR(TODAY()): This filters data to include only records from the current year.
Once you've created this field, drag it to the Filters shelf on your worksheet and select "True". Now your view is dynamically filtered for YTD data and will update automatically as the year progresses.
4. Highlighting Recent Activity: Creating a "Last N Days" Filter
Want to see sales from the last 7 days? Or user sign-ups from the last 30? The TODAY() function, combined with DATEADD(), makes this easy. The DATEADD() function adds or subtracts a specified interval from a date.
The DATEADD() syntax is:
DATEADD('date_part', interval, date)
Example: Show data from the last 7 days
Create another boolean calculated field named "Last 7 Days" using this formula:
[Order Date] >= DATEADD('day', -7, TODAY()) AND [Order Date] <= TODAY()
Here, DATEADD('day', -7, TODAY()) calculates the date that was 7 days ago. The formula then finds all order dates that fall between 7 days ago and today. Drag this field to the Filters shelf and select "True" to activate it.
To make it even better, you can create a parameter to let users choose the number of days they want to see. Create an integer parameter called "Days to View," then replace the hardcoded "-7" in your formula with your parameter: DATEADD('day', -[Days to View], TODAY()).
5. Creating a Countdown to a Future Event
You can also use TODAY() to look forward and calculate the time remaining until a future deadline, product launch, or subscription renewal.
Example: Days until a subscription expires
If you have a field called [Expiry Date], you can find the days remaining with this formula:
DATEDIFF('day', TODAY(), [Expiry Date])
This will return the number of days between today and the expiry date. If the expiry date is in the past, the result will be a negative number, which you can use to identify expired subscriptions.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
TODAY() vs. NOW(): A Crucial Distinction
As mentioned earlier, TODAY() returns only the date component of the current moment, while NOW() returns both the date and time. This distinction is critically important for accurate daily analysis.
Imagine you have data for transactions throughout today. If you create a filter like [Transaction Datetime] = NOW(), you'll likely see no data at all, because NOW() looks for an exact match down to the second.
More subtly, if you filter for all transactions that occurred "today," a calculation relying on NOW() could give you incomplete data. For instance, if you check a dashboard at noon, a filter looking at transactions before NOW() would exclude all transactions that happen later in the day. Using TODAY() resolves this by treating all timestamps from the current day as "today."
Rule of thumb: If your analysis is at the daily, weekly, or monthly level, always default to using TODAY(). Only use NOW() when it is necessary for time-based analysis, like server transaction logs or manufacturing line outputs.
Data Refreshes and "Today's" Date
It's vital to understand how TODAY() behaves based on your data connection type:
- For Live Connections: The
TODAY()function will always return the actual current date each time you open or refresh the workbook. - For Data Extracts: When using a Tableau Data Extract (.hyper file),
TODAY()returns the date of the last time the extract was refreshed. This is a common source of confusion. If your extract only refreshes once a day, your "Today's Date" field will be static until the next refresh. This isn’t a mistake, it’s by design, ensuring that your calculations are consistent with the data included in the extract.
Keep your data refresh schedule in mind when building dashboards. A title that says "Last Updated: [Today's Date]" can quickly become misleading if the underlying data extract is several days old.
Final Thoughts
Learning to use the TODAY() function is a fundamental step toward building smarter, more automated, and more user-friendly dashboards in Tableau. This simple function opens up a world of possibilities for dynamic filters, date-based calculations, and providing users immediate context, turning your reports from static snapshots into living analytical tools.
Mastering functions and syntax in complex tools like Tableau is a powerful skill, but sometimes you just need to get answers quickly without searching for formulas. We built Graphed for exactly those moments. Using our tool, you operate with plain English. You can simply ask things like "show me our year-to-date sales compared to last year" or "create a dashboard of our Facebook ads ROI for the last 30 days," and instantly get back dynamic, real-time charts. It streamlines the whole process so you can focus on the insights, not the setup.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.