Gantt Chart in Tableau

Recently, we were analysing the order timeline of product shipment. We wanted to know how long it took for orders to be shipped after they were placed in different shipping modes.

As a solution for this, we used the Gantt bar chart, in which we can show the duration of hours between the order and the shipping for selected orders.

In this blog, I will explain what a Gantt chart is in Tableau and how we can use it in scenarios such as displaying a timeline of each order’s shipping duration on the chart.

What is a Gantt Chart in Tableau?

In Tableau, a Gantt chart is used to represent the duration of activities or tasks over a timeline. The duration can be between hours, days, weeks, months, and years.

In the Gantt chart, each task is represented by a horizontal bar, where the position of the bar shows when the task starts, and the length of the bar shows how long it lasts.

Create a Gantt Chart in Tableau

In Tableau, there are two ways we can create a Gantt chart: one is manually by selecting dimensions and creating a calculated field. The other method is using the built-in Gantt bar from the list in the Show Me tab.

Create a Gantt Chart Manually in Tableau

In this example, I will use the Superstore data to show the average time duration to ship the order in each shipping mode.

Connect the Tableau desktop with Superstore data and follow the steps below.

  1. Drag the Ship mode to the Rows, and Order Date to the Columns.
Create Gantt Chart in Tableau
  1. Click on the Order date and select Measure > Minimum.
display time duraion using the gantt chart
  1. Here, the Order date and shipping date are in date format. To calculate the hours between these dates, we need to create a calculation field.

Click on the Analysis tab and select a calculative field. Enter the label for the field and enter the formula below.

DATEDIFF('hour',[Order Date],[Ship Date])
Tableau Gantt bar chart
  1. In the Marks section, change the format to Gantt and drag the calculative field to the Size card in the Marks section.
Create a Gannt Chart in Tableau
  1. In the time duration, we have to show the average of hours for that click on the calculative field in the Size and select Measure Sum > Average.
Use Gantt Chart in Tableau

Check out: Waterfall Chart in Tableau

  1. To show the average of hours on the bars, drag the calculative field to the Label card in the Marks section and set its Measure to Average.
Display time duration with gantt chart in Tableau

Now we can see the average duration of hours it takes to ship the order in different shipping modes.

Create a custom Gamtt bar chart in Tableau

This is how we can use the Gantt bar chart in Tableau to display the duration between two time fields.

Create a Gantt Chart Using Built-in Charts in Tableau

In Tableau, we also have a built-in option to create a Gantt Chart. Using this method, we only need to select the Dimension and Measures and click the Gantt Chart option.

It will auto-place the fields and display the data in the Gantt chart format.

In this example, we will create a Gantt bar chart to track how many days each order took to ship, showing the duration between the Order date and shipping date.

  1. Create a calculated field to calculate the days between the shipping date and the order date. Click on the Analysis tab and select Create Calculative Field.

Enter the below formula and click OK.

DATEDIFF('day', [Order Date], [Ship Date])
Inbuilt Gantt Bar chart in Tableau

Check out: Divergent Stacked Bar Chart in Tableau

  1. Now, drag the Order Date to the Columns and Order ID to the Rows.
Calculate shipping days using Gantt chart in Tableau
  1. The Order ID contains a large number of records. When we add it to columns, it shows the warning. In the warning window, click Filter and then add.
Add filter in tableau gantt bar chart
  1. In this, I have filtered out the order records of the year 2025. For this, click on the Wildcard tab and enter the value US-2025 ( initial of order ID), then select Contains and click OK to apply the filter.
Tableau gantt chart filter to sort records
  1. Now, we will have the filtered records for the year 2025. Here, we can adjust the timeline range using the slider on the left side.
Tableau Gantt chart with filters
  1. By default, the Order Date will be in the Year format, but here we need the data in days. For that, click on the Order date and select the option Exact date.
Show duration between days using Gantt chart in Tableau

Check out: Stacked Bar Chart in Tableau

  1. Drag the calculated field Shipping Time to the Size card, and to show the duration in days, drag the calculated field to the Label card.
Add size in Tableau Gantt Chart
  1. After this, click on the Show Me tab and select the Gantt chart.

Now, you will see the number of days it took from the order date to ship the specific product.

Tableau Gantt Bar Chart filters

This way, we can use the built-in Gantt chart from the Show Me tab to display the data metrics in a Gantt chart.

By following the above two methods, we can effectively use Gantt charts in Tableau to visualize the time duration between events such as order placement and shipment.

Creating a Gantt chart for scenarios like the example above helps to analyze delivery delays, improve the shipment process, and provide better customer service.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.