How to Get Current Month in Tableau

Cody Schneider••7 min read

Manually updating your Tableau dashboards to show the current month's performance is a tedious and unnecessary chore. To keep your reports relevant and timely, you need a dynamic filter that automatically updates as soon as the calendar flips to a new month. This article will show you exactly how to create a calculated field in Tableau that always filters your view to the current month, with no manual adjustments required.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why a Dynamic Filter is a Game-Changer

Before jumping into the "how," let's quickly touch on the "why." Relying on manual date filters is a common headache. Every month, someone has to remember to open the workbook, change the filter, save, and republish. This simple task can easily be forgotten during a busy week, leading to stakeholders looking at stale data and making decisions based on outdated information. By creating a dynamic filter, you ensure three key things:

  • Efficiency: You build the filter once, and it works forever. This "set it and forget it" approach saves you cumulative hours of repetitive work over the life of the dashboard.
  • Accuracy: The filter is based on the actual current date, eliminating the risk of human error. No more accidentally setting the filter to the wrong month or year.
  • Timeliness: Your team and leadership can trust that the dashboard they open always shows the most current period’s performance, empowering them to react quickly to new trends.

The Simplest Way: Creating a "Current Month" Calculated Field

The most reliable method for isolating the current month is by creating a calculated field that returns a simple "True" or "False" value. This boolean (True/False) result tells Tableau whether a given row of your data falls within the current month. This method is incredibly efficient for Tableau to process, leading to better dashboard performance.

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.

Step-by-Step Instructions

Let's walk through the process. For this example, we’ll assume you’re using Tableau’s Sample Superstore dataset and your date field is named [Order Date].

  1. Navigate to the top menu and select Analysis > Create Calculated Field... or right-click on an empty space in the Data pane on the left and select Create Calculated Field....
  2. A dialog box will open. Name your new field something clear and descriptive, like "Is Current Month?".
  3. In the formula box, enter the following calculation:
  4. The calculation editor should show a message at the bottom saying "The calculation is valid." Click OK.

That's it! You've successfully created the logic. Now you just have to apply it.

Breaking Down the Formula

You might be wondering what exactly that short line of code does. It’s a simple but powerful comparison.

  • **TODAY()**: This function returns the current date from your system's clock. If today is October 26, 2024, TODAY() returns that exact date.
  • **DATETRUNC('month', [Order Date])**: DATE TRUNCation is a function that 'chops off' a date to a specific level of precision you define. When you use 'month', it effectively rounds the date down to the very first day of that month.

So, our complete formula — DATETRUNC('month', [Order Date]) = DATETRUNC('month', TODAY()) — translates to this plain English comparison: "Does the first day of the month for this order's date match the first day of the month for today's date?"

For any row with an [Order Date] in the current month, this will be TRUE. For any row from a different month, it will be FALSE.

How to Use Your New Calculated Field to Filter the View

Now that you have your "Is Current Month?" calculated field, you can use it to filter any sheet or dashboard.

  1. Find your new field, "Is Current Month?", in the Data pane (it will have a "T|F" icon next to it).
  2. Drag the "Is Current Month?" field onto the Filters card.
  3. A filter dialog box will appear. Check the box for True and click OK.

Your visualization will now automatically update to show data only from the current month. When next month begins, the TODAY() function will return a date in the new month, and the filter will automatically adjust without you needing to do a thing.

Beyond a Simple Filter: Practical Applications

You can leverage this same logic for more advanced scenarios that are common in business reporting.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Comparing Current Month to Previous Month

Seeing the current month’s performance is great, but comparing it to the previous month is even better. We can create another calculated field to flag the previous month's data.

  1. Create a new calculated field named "Is Previous Month?".
  2. Enter the following formula:

This formula uses the **DATEADD** function to subtract one month from today's date before truncating it, effectively finding the first day of the previous month.

  1. Create one more calculated field called "Period of Interest". This will help us label our data neatly for comparison.
  2. Drag "Period of Interest" to the Filters shelf and exclude "Other".
  3. Now, you can drag "Period of Interest" onto the Columns shelf and SUM(Sales) onto the Rows shelf to create a beautiful side-by-side comparison bar chart that will always show the current and previous months.

Showing "Current Month" in Your Dashboard Title

Static titles like "Monthly Sales Performance" are fine, but a dynamic title like "Sales Performance for October 2024" is much more professional. Here’s how to add a dynamic date to your title.

  1. Create a new calculated field named "Dynamic Month Title".
  2. Use this formula to generate a clean string of the current month and year:
  3. Drag this "Dynamic Month Title" field onto the Detail card of the Marks card in your primary worksheet. You won’t see anything change on the viz itself, but this makes the field available to the title.
  4. Double-click the worksheet title to open the Edit Title dialog box.
  5. Type your static text, for example, "Sales Performance for ". Then click the Insert button on the right and select your "Dynamic Month Title" field from the list.
  6. It will look something like this: Sales Performance for <Dynamic Month Title>.
  7. Click OK, and your title will now update automatically each month.

Pro Tips and Common Pitfalls

As you get comfortable with these calculations, here are a few things to keep in mind.

TODAY() vs. NOW()

Tableau has two similar functions for the current time: **TODAY()**, which returns just the date (e.g., 2024-10-26) and **NOW()**, which returns the date and time (e.g., 2024-10-26 14:30:15). For month-level filtering, TODAY() is almost always what you need. NOW() is more useful if you are analyzing data at the hour or minute level and you're working with a datetime field, but it can be affected by server time zones depending on where your Tableau Server is hosted.

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.

Check Your Data Types

These date calculations will not work if Tableau doesn't recognize your date field as a proper date or datetime. If you’re having trouble, check the data type of your date field in the Data pane. It should have a small calendar icon next to it. If it shows "Abc" or "#", click the icon and change the data type to Date or Date & Time.

Context Filters for Performance

If you're working with a massive dataset (millions of rows), you can improve dashboard performance by making your "Is Current Month?" filter a context filter. Right-click the filter on the Filters shelf and select Add to Context. This tells Tableau to apply this filter first, reducing the amount of data it has to process for other filters and calculations in the viz, which can significantly speed things up.

Final Thoughts

By moving away from static date filters and embracing dynamic calculated fields, you can build smarter, more automated dashboards in Tableau. Mastering the **TODAY()** and **DATETRUNC()** functions is a huge step toward saving time and ensuring your reports are always accurate and ready for your audience.

While mastering these calculations in Tableau is a valuable skill, we know that sometimes you need to get an answer quickly without opening a new application or writing a custom formula. At Graphed , we’ve created a way for marketing and sales teams to get immediate insights from all their data sources. Rather than learning functions and syntax, you can simply ask questions in plain English, like "Show me my sales from Shopify vs. Facebook Ad spend this month," and instantly get an updating dashboard, created for you in seconds.

Related Articles