KNOWLEDGE BASE

Gantt Bars do not Line Up Correctly When Date Field is set to a Date Level Other than DAY


Published: 21 Sep 2017
Last Modified Date: 25 Sep 2017

Issue

When creating a Gantt chart where the date field is set to a date level other than DAY, then the Gantt bars in the view are not aligned with the date axis as expected.

For example, in a Gantt chart where each bar is the length of time between when an order is placed and when an order is shipped, all of the bars begin on the first day of the month despite the fact that orders occurred all during the month.
 

Environment

Tableau Desktop

Resolution

Change the date level to DAY. If desired, format the axis to show date labels at the month level. 

The attached example workbook uses the sample data set Superstore to demonstrate the following directions:
  1. Right-click MONTH(Order Date) on the Columns shelf and select the second DAY option.
  2. Right-click DAY(Order Date) on the Columns shelf and select Format…
  3. In the left-hand Format pane, for the Dates dropdown specify the desired date format. In this example, the custom date format "mmmm" is used.
  4. Right-click the date axis at the bottom of the view and select Edit Axis…
  5. In the Edit Axis dialog, do the following and click OK:
    1. Navigate to the Tick Marks tab
    2. For Major tick marks, select Fixed
    3. For Every, select 1 Months

Cause

Tableau Desktop truncates dates to the date level selected. For example, if the date is 1/20/2018, and the MONTH level is selected, then the Gantt bar will start on 1/1/2018.
Did this article resolve the issue?