6 Advanced Visualizations in Tableau - by Payal Patel - Towards Data Science
6 Advanced Visualizations in Tableau - by Payal Patel - Towards Data Science
6 Advanced Visualizations in
Tableau
An overview of advanced visualizations in Tableau, including step-by-
step examples
135 1
Image by Author: Advanced visualizations in Tableau
While the standard visualizations are great, there are times when an
advanced technique is needed. Recently I created a dashboard visualizing
deals made on the show Shark Tank. Below are some advanced visualization
techniques used in that dashboard, with step-by-step guidance on how to
recreate the visuals — either with the same dataset or a different one! This
list can also be a great way to learn about different visualization types and
brainstorm how to incorporate them in other tools!
2. Sankey Diagrams
3. Word Clouds
4. Lollipop Charts
5. Radial Charts
Donut Charts
Donut charts, like pie charts, show parts to a whole relationship. They are
different in that there is a hole in the center of the circle, like a donut.
The donut chart in the Shark Tank dashboard shows the total pitches made,
segmented based on Deal or No Deal.
To create this donut chart, start by creating a pie chart in a new worksheet.
From the Data Pane, add the Number of Records (i.e. Number of Pitches) to
the Columns shelf, and Got Deal to the Rows shelf.
Note: Make sure to convert the Got Deal measure to a dimension, as shown in the
image below.
Image by Author: Number of Records measure on Columns shelf and Got Deal dimension on Rows shelf
Select the pie chart visualization type from the Show Me tab. This will
generate the base visualization for the donut chart.
Image by Author: Base pie chart for developing donut chart
On the Rows shelf, add two new measures. Type AVG(0) on the Rows shelf
twice. (i.e. AVG(0) AVG(0)). Once added to the Rows shelf, you will see two
pie charts.
Image by Author: Two pie charts, result of AVG(0) AVG(0) addition to Rows shelf
Select Dual Axis on the second measure on the Rows shelf to overlap the two
pie charts.
Image by Author: Select Dual Axis
The two pie charts will now overlap one another. Adjust the size of each pie
chart to create the donut shape. Under the Marks card, select Size and
increase the size of the pie charts by moving the slider to the right.
Image by Author: Adjust size of pie chart
To create the inner donut, adjust the second, or bottom pie chart. On the
Marks card, navigate to the card for the second measure, and remove all
fields. In this case, there are 4 fields to remove.
Image by Author: Remove additional fields from Marks card
Removing these fields will result in a gray circle in the center. This is the
center of the donut chart. Adjust the size on the Marks card to adjust the size
of the donut.
Image by Author: Adjust size of inner circle of donut chart
Use the Marks card to adjust the color of the center of the donut chart.
Image by Author: Adjust color of center of donut chart to white to match chart background
Use the first pie chart, the second tile under the Marks card, to adjust the
labels and colors of the donut chart.
Image by Author: Format label and colors on donut chart
Add text to the center of the donut chart by moving a measure to Label on the
All Marks card.
Image by Author: Add text to center of donut chart
Right click on the headers, and uncheck Show Header to remove axis headers.
Image by Author: Remove headers on chart
Right click anywhere on the worksheet and select Format to open the Format
pane. Use the Format pane to hide gridlines, adjust the border, change the
background color, and more.
Image by Author: Open Format Pane for additional formatting capabilities
The following image shows the final donut chart, after formatting with the
Marks card and Format pane.
Image by Author: Donut Chart Displaying Total Pitches by Deal or No Deal
Sankey Diagrams
Sankey diagrams display flows from one entity to another. The sankey
diagram in the Shark Tank dashboard displays the flow of deals from
pitchers gender (i.e. team composition) to industry.
Step 1: Self-Union
To create a Sankey diagram, upload the dataset, and then create a self-union
of the data source. The following image shows the dataset loaded, with a
total of 1274 records and 50 fields.
To create a self-union, move Shark Tank US dataset from Sheets, onto the
Shark Tank US dataset on the canvas. Notice the number of rows doubles
from 1274 to 2548.
Image by Author: Self-union Shark Tank dataset
The self-union creates two fields — the Table Name field will be used later in
this exercise.
3. t: (INDEX() — 25) / 4
4. Rank 1: RUNNING_SUM(SUM([Number of
Records]))/TOTAL(SUM([Number of Records]))
5. Rank 2: RUNNING_SUM(SUM([Number of
Records]))/TOTAL(SUM([Number of Records]))
6. Sigmoid: 1 / (1 + exp(1)^-[t])
The following image shows an example of how to create the calculated field,
ToPad, in Tableau.
Image by Author: Example creating calculated field, ToPad, for sankey diagram
The following image shows how to create a bin on ToPad called Padded, with
a bin size of 1.
Move Industry, Pitchers Gender, and Table Name to Details on the Marks
Card.
Image by Author: Marks card on Sankey diagram worksheet
Select Edit Table Calculation on the Curve measure, on the Rows shelf.
Image by Author: Select Edit Table Calculation on Curve
Ensure Pitchers Gender is at the top, as this will be on the left of the
Sankey diagram
Image by Author: Rank 1 table calculations
Ensure Industry is at the top, as this will be on the right of the Sankey
diagram
Image by Author: Rank 2 table calculations
Now, select Edit table calculation from the drop-down options on the t
measure, on the Columns shelf. For t, update the table calculation as follows:
Open in app
2
Search Write
Image by Author: t table calculations
The sankey diagram will take start to take shape on the worksheet.
Image by Author: Initial sankey diagram markings
Add color to the Sankey Diagram by changing the Mark type of the Industry
and Pitchers Gender fields on the Marks card, as seen in the image below.
Add Got Deal and Pitchers Gender to the Filters card, to filter the dataset to
show the number of deals.
Image by Author: Format Sankey Diagram
Edit the X & Y axis range. To edit an axis, right-click on the axis and select
Edit Axis.
Hide the headers on each axis for a cleaner visual. (Note: To do this, right
click on the header, and uncheck Show Header)
Move Deal Sizing to Size on the Marks card and increase the size to increase
thickness of the lines on the diagram. The thickness of these lines reflects
the number of deals flowing from Pitchers Gender to Industry. On Deal
Sizing, select Compute using Padded, as seen in the following image.
Image by Author: Add Deal Sizing to visualization
Repeat for the Industry field, but this time select the Gray color palette.
Image by Author: Bar chart displaying total number of deals by Industry
Now it’s time to put it all together! Create a new dashboard and add the three
worksheets together, as seen below. Adjust the background color and
borders using the Format pane.
Image by Author: Dashboard combining three visuals for Sankey Diagram
To add a dashboard action, from the main menu, select Dashboard → Actions
→ Add Action → Highlight.
Image by Author: Add dashboard action
This will allow the user to hover over the chart on the left and see where the
deals are moving to on the right.
Image by Author: Pitcher Gender Highlight Action
Enter the following information to create the Hover Highlight Action for
Industry.
Image by Author: Create highlight action for Industry
The user can now hover over Industry, and see the proportion of Pitchers
Genders making deals.
Image by Author: Industry Highlight Action
Word Clouds
Word clouds display the most common words in a text, with the most
frequent words appearing the largest. The words are arranged in the shape
of a “cloud”, hence the name of the visualization type, word cloud. Word
clouds are useful in some cases, such as visualizing word frequency within a
text column.
To start, open a new worksheet. Move Industry onto Text on the Marks card,
and Number of Records (i.e. Number of Pitches) onto Size. Additionally,
move Industry to Color.
Image by Author: Initial dimensions and measures on Marks card
This will result in a heat map as seen below. To transform this visual into a
word cloud, on the Marks card, change the visualization type to Text.
This results in a word cloud. Use the Marks card to make changes to the
format.
Image by Author: Word Cloud Displaying the Number of Deals by Industry
Lollipop Charts
Lollipop charts are similar to bar charts. They display frequency across
different categories. Where lollipop charts differ from bar charts is in the
visual display. While bar charts use rectangles to display values for each
category, lollipop charts add a circle to the top of each bar. This type of
visualization can be useful when creating a infographic or dashboard.
The lollipop chart in the Shark Tank dashboard displays the number of deals
by shark.
To begin, add Got Deal and Measure Names to the Columns shelf. Convert
Got Deal to a discrete dimension by selecting the options on the field.
Image by Author: Got Deal and Measure Names added to Columns shelf
Add Measure Values to the Rows shelf twice. Don’t worry, in a few more steps
the lollipop chart will start to take shape!
On the Measure Values card, add the following fields: Barbara Invested,
Daymond Invested, Kevin Invested, Lori Invested, Mark Invested, Robert
Invested. Change each of these fields to Measure (Sum), as seen in the
following image. Remove any other fields from the Measure Values card not in
this list.
Image by Author: Measure Values final list
Add Got Deal to the Filters card. Filter for Got Deal = 1, equivalent to “Got
Deal”.
Image by Author: Add Got Deal to Filters card
On the Marks card, change the chart type on the Measure Values card to Bar,
and adjust the size.
Image by Author: Change chart type on Measure Values Marks card
On the second Measure Values card, change the type to Circle, and adjust the
size using the Size tile.
Image by Author: Adjust size on Marks card
Move the Measure Values pill to Text tile on the Measure Values Marks card, to
add labels to the circles on the chart.
Image by Author: Add labels to chart
Right click on the y-axis, and uncheck Show Header, to remove the additional
header. Use the Format pane to change the background color, format axes,
and modify the text labels. To open the Format pane, right click on the
worksheet and select Format.
Image by Author: Open Format Pane
Radial Chart
Radial charts are another way to display categorical information. Radial
charts can be a great alternative to bar charts.
In the Shark Tank dashboard, the radial chart displays deals by the number
of Sharks in the deal. To create a radial chart in Tableau, one dimension and
one measure is required. Additionally, 9 calculated fields and 1 bin will be
created in the process. The following steps outlines how to recreate this
chart.
Step 1: Self-Union
To create a radial chart, upload the dataset, and then create a self-union of
the data source. The following image shows the dataset loaded, with a total
of 1274 records and 50 fields.
To create a self-union, move Shark Tank US dataset from Sheets, onto the
Shark Tank US dataset on the canvas. Notice the number of rows doubles
from 1274 to 2548.
2. Path (Bin): — Right click on the Path field and select Create → Bins to
create a new Bin called Path (Bin). Set the Size of bins equal to 1.
3. Index-1: INDEX()-1
The following image shows an example of how to create the calculated field,
PATH, in Tableau.
Image by Author: Example creating calculated field, PATH, for sankey diagram
The following image shows how to create a bin on PATH called Path (bin),
with a bin size of 1.
Image by Author: Example creating bin, Path (bin), for sankey diagram
On the Marks card, change the mark type to Line. Move Path(Bin) from the
Rows shelf to Path on the Marks Card. Make sure Number of Sharks is a
dimension and not showing the sum.
Image by Author: PATH(bin) and Number of Sharks in Deal on Marks card
Once the table calculations are updated, the base of the radial chart begins
to take shape.
Image by Author: Radial Chart Base
Start by creating two bar charts on a worksheet. Move Industry to the Rows
shelf, and Number of Records (i.e. total pitches) and Got Deal to the Columns
shelf.
Image by Author: Two bar charts showing Deals and Pitches by Industry
Adjust the size of the bars with the Number of Records and Got Deal Marks
card. Make the Got Deals bar (navy blue) smaller than the Number of
Records bar (light blue), as seen in the following image.
Image by Author: Adjust size of bars
Use the Marks card to add labels and format the visual as needed. The
following image shows the final nested bar chart.
Image by Author: Nested bar chart displaying total deals and pitches by industry
Payal is a Data & AI specialist. In her spare time, she enjoys reading, traveling,
and writing on Medium. If you enjoy her work, follow or subscribe to her list, and
never miss a story!
The above article is personal and does not necessarily represent IBM’s positions,
strategies, or opinions.
References
[1]: Thirumani, Satya. “🦈 Shark Tank Us Dataset 🇺🇸.” Kaggle, 28 Aug. 2023,
www.kaggle.com/datasets/thirumani/shark-tank-us-dataset. (CC0: Public
Domain license)
Payal Patel in Towards Data Science Dominik Polzer in Towards Data Science
GenAI with Python: RAG with LLM The Dos and Don’ts of Dashboard
(Complete Tutorial) Design
Build your own ChatGPT with multimodal data Quick Tips to Create an Impactful Dashboard
and run it on your laptop without GPU
See all from Payal Patel See all from Towards Data Science
Lists
May 4 1 Jun 14 82
Bo Yuan, Ph.D. John Loewen, PhD in Data Storytelling Corner