Last Modified Date: 09 Dec 2022
Environment
Tableau DesktopAnswer
A DNA chart can be created with a dual axis Gantt bar and Circle chart. The attached example workbook uses the example data set Superstore to demonstrate the following directions:- Drag [Sales] to the Columns shelf
- Drag [Sub-Category] to the Rows shelf
- Drag [Order Date] to Color on the marks card
- Drag [Order Date] to the Filter shelf
- In the Filter Field dialog, select Years and click Next >
- In the Filter dialog, check only 2014 and 2015 and click OK
- On the marks card, in the drop-down, select Circle
- Create a calculated field with a name like "2015 Sales" with a calculation similar to the following:
{ FIXED [Sub-Category] : SUM ( IF YEAR([Order Date]) = 2015 THEN [Sales] END ) }
- Create a calculated field with a name like "Difference" with a calculation similar to the following:
{ FIXED [Sub-Category] : SUM( IF YEAR([Order Date]) = 2014 THEN [Sales] END ) } - [2015 Sales]
- Drag [2015 Sales] to the Columns shelf.
- Click [2015 Sales] on the Columns shelf to open the SUM(2015 Sales) marks card.
- In the SUM(2015 Sales) marks card, do the following:
- In the dropdown, select Gantt Bar
- Remove YEAR(Order Date) from Color
- Drag [Difference] to Size
- Optional: click Size and adjust the thickness of the bar with the slider.
- Right-click [2015 Sales] on the Columns shelf and select Dual Axis
- Right-click the Sales axis at the bottom of the view and select Move marks to front
- Right-click [2015 Sale] on the Columns shelf and un-check Show Header
Additional Information
To view the above steps in action, see the video below.Note: the video has no sound. To view the video in higher quality, click the YouTube icon below to watch it on YouTube directly.
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials