How to Make a Gantt Chart in Tableau
A Gantt chart is one of project management's most dependable tools, and for a good reason: it turns a complicated project schedule into a clear, visual timeline. If you're using Tableau, you have a powerful tool at your fingertips to create one. This guide will walk you through building a dynamic and informative Gantt chart in Tableau, from setting up your data to adding advanced features like progress tracking.
What is a Gantt Chart, Anyway?
Think of a Gantt chart as a specialized bar chart that maps out tasks against time. It’s the perfect way to get a bird's-eye view of a project's entire lifecycle. On the vertical axis, you have a list of tasks, and on the horizontal axis, you have your project timeline (days, weeks, or months).
Each bar on the chart represents a single task, and its length and position show a few key things:
- Start Date: Where the bar begins.
- End Date: Where the bar ends.
- Duration: The total length of the bar.
Project managers love them because they make it easy to see which tasks are happening when, who is responsible for what, and how the entire project is progressing. They transform a spreadsheet full of dates and names into something everyone on the team can understand at a glance.
Preparing Your Data for a Gantt Chart
Before you even open Tableau, the most crucial step is to get your data structured correctly. A clean and simple dataset will make the rest of the process smooth and easy. If your data isn't set up right, you'll be fighting the tool every step of the way.
At a minimum, your spreadsheet (whether it’s in Excel or Google Sheets) should have three essential columns:
- Task Name: An identifier for each task or sub-task in your project (e.g., "Draft Website Copy," "Develop Homepage," "User Testing Phase").
- Start Date: The date each task is scheduled to begin.
- End Date: The date each task is scheduled to be completed.
You can also include other helpful columns to make your chart more insightful, such as:
- Project Phase: The larger project category the task belongs to (e.g., "Discovery," "Development," "Launch").
- Team Member: The person or team responsible for the task.
- Percent Complete: A numerical value (e.g., 0.75 for 75%) indicating how much progress has been made on the task.
Calculating the Task Duration
Tableau needs to know two things to draw your Gantt bars: where they start and how long they should be. Your data provides the start date, but you need to calculate the duration. This is done inside Tableau with a calculated field.
The formula uses the DATEDIFF function, which calculates the difference between two dates. Here’s how you'll set it up:
DATEDIFF('day', [Start Date], [End Date])
Let's break that down:
'day': This tells Tableau to measure the duration in days. You can easily switch this to'week'or'month'depending on the scale of your project.[Start Date]: This pulls the start date from your data source.[End Date]: This pulls the end date from your data source.
Don't worry about creating this just yet, we'll cover exactly where to put this formula in the steps below.
Step-by-Step: Creating Your Basic Gantt Chart in Tableau
With your data prepped, you're ready to build. Follow these steps to create your core Gantt chart.
Step 1: Connect to Your Data Source
Open Tableau and in the "Connect" pane on the left, choose an appropriate connector for your data (e.g., "Microsoft Excel" or "Google Sheets"). Navigate to your file and open it. Tableau will display a preview of your data, allowing you to confirm that everything looks correct.
Step 2: Set Up Your Rows and Columns
This is where you'll build the visual structure of your chart.
- Drag your Task Name dimension from the Data pane onto the Rows shelf. You should now see a list of your tasks along the left side.
- Drag your Start Date dimension to the Columns shelf. Tableau will probably default to showing the year. To fix this, right-click the
YEAR(Start Date)pill on the Columns shelf and select the exact date option, which might look like May 8, 2015. - Right-click the Start Date pill again and make sure it's set to Continuous. This creates a proper timeline instead of discrete date parts.
At this point, you'll have a list of tasks with a single dot next to each one marking the start date.
Step 3: Change the Mark Type to Gantt Bar
Tableau needs to be told you want to create a Gantt chart. On the Marks card, click the dropdown menu that likely says "Automatic" and select Gantt Bar. The little dots on your chart will now turn into small, thin bars.
Step 4: Define the Length of Your Bars
Now it's time to tell Tableau how long each bar should be using the DATEDIFF calculation we discussed earlier.
- At the top menu, select Analysis > Create Calculated Field.
- Name your new field something descriptive, like "Task Duration".
- In the formula box, enter:
DATEDIFF('day', ATTR([Start Date]), ATTR([End Date])) - Note: You might need to use
ATTR()around your date fields if Tableau sees them as aggregated measures. - Click OK.
- Find your new "Task Duration" field in the Data pane and drag it onto the Size property on the Marks card.
Voila! Your thin bars will instantly stretch to their correct lengths, representing the duration of each task. You now have a functional Gantt chart.
Step 5: Sort Your Tasks
To make the timeline easier to read, you'll want to sort your tasks chronologically so the earliest tasks appear at the top.
- Hover over the Task Name axis title until a small sort icon appears, and click it.
- Or, for more control, right-click the Task Name pill on the Rows shelf and select Sort.
- In the dialog box, set Sort by to Field, choose Start Date as the field name, and select Ascending for the sort order.
Your chart will now cleanly display tasks from top to bottom based on their start date.
Taking Your Gantt Chart to the Next Level
Your basic chart is great, but a few small enhancements can add layers of valuable information.
Add Color to Group Tasks
If your data includes a category like Project Phase or Team, you can use it to color-code your bars. Simply drag that dimension from the Data pane onto the Color property on the Marks card. Tableau will automatically assign a different color to each phase or team, making it instantly clear who is responsible for what or which tasks belong together.
Visualize Task Progress
This is a slightly more advanced technique that uses a dual-axis chart to overlay progress atop the total task duration. It requires you to have a "Percent Complete" measure in your dataset.
- Create another calculated field named "Progress Duration" with the formula:
[Task Duration] * [Percent Complete] - Drag the new Start Date measure to the Columns shelf, placing it next to the original Start Date.
- On the Marks card, which now has two sections, go to the second Marks shelf. Change the mark type back to Gantt Bar, and reduce the size to be thinner than the original bar. Change its color to something dark, like black or a darker shade of the original bar's color.
- Drag your "Progress Duration" calculation onto the Size property.
- Right-click the second date pill on the Columns shelf and select Dual Axis.
- Finally, right-click on the top axis and select Synchronize Axis to align them perfectly.
You’ll now have a thinner, darker bar inside each task bar, visually showing how much of that task has been completed.
Use Labels for Key Information
You can add important details directly onto the chart. For example, dragging your Team Member dimension or Percent Complete measure on the Label property on the Marks card will display that information right next to each bar.
Best Practices for Effective Gantt Charts
- Keep It Tidy: Don't cram too much text onto the chart itself. Use labels for the most critical info and move secondary details (like notes or specific dates) into the tooltip, which appears when you hover over a bar.
- Use Color Smartly: Use color to convey meaning (like project phase or status), not just for decoration. Stick to a simple, logical palette.
- Add a "Today" Marker: To see where you are right now, you can add a reference line for the current date. Right-click the date axis, select Add Reference Line, and in the dialog box, set the Value to
TODAY()and choose an appropriate label and format. - Choose the Right Timescale: Adjust your date axis to show days, weeks, or months to fit the overall length of your project. Right-click the axis and go to Format to adjust the scale.
Final Thoughts
Creating a Gantt chart in Tableau is a fantastic way to map out project schedules, track progress, and keep everyone on your team on the same page. Once you have your data structured correctly, you can use these steps to build a simple visual timeline or an advanced progress-tracking dashboard that gives you deep insight into your project's health.
While building charts directly in tools like Tableau is powerful, we know the whole process of connecting data, creating calculated fields, and tweaking visualizations can still be time-consuming. At Graphed, we use natural language to turn these multi-step processes into a single sentence. You can just ask, "Create a Gantt chart showing the timeline for our marketing campaigns, color-coded by team," and have a real-time, shareable chart in seconds, streamlining your reporting so you can focus on the project itself.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.