0% found this document useful (0 votes)
22 views81 pages

6 Advanced Visualizations in Tableau - by Payal Patel - Towards Data Science

The document provides an overview of six advanced visualization techniques in Tableau, including Donut Charts, Sankey Diagrams, Word Clouds, Lollipop Charts, Radial Charts, and Nested Bar Charts, with step-by-step instructions for creating each type. It emphasizes the use of these techniques in visualizing data from the Shark Tank dataset, showcasing how to implement them effectively. Each visualization type is explained with detailed guidance on the necessary calculations and formatting to achieve the desired results.

Uploaded by

papalinux
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views81 pages

6 Advanced Visualizations in Tableau - by Payal Patel - Towards Data Science

The document provides an overview of six advanced visualization techniques in Tableau, including Donut Charts, Sankey Diagrams, Word Clouds, Lollipop Charts, Radial Charts, and Nested Bar Charts, with step-by-step instructions for creating each type. It emphasizes the use of these techniques in visualizing data from the Shark Tank dataset, showcasing how to implement them effectively. Each visualization type is explained with detailed guidance on the necessary calculations and formatting to achieve the desired results.

Uploaded by

papalinux
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Be part of a better internet.

Get 20% off membership for a limited time

6 Advanced Visualizations in
Tableau
An overview of advanced visualizations in Tableau, including step-by-
step examples

Payal Patel · Follow


Published in Towards Data Science · 17 min read · Dec 6, 2023

135 1
Image by Author: Advanced visualizations in Tableau

Tableau is a data visualization tool used to create data visualizations,


dashboards, and stories. When I first started using this tool, I often used the
Show Me feature to create data visualizations. This feature allows users to
create common visualization types, such as bar charts and line graphs.

Image by Author: Tableau Show Me Feature

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!

This post goes through the following 6 data visualization techniques.


1. Donut Charts

2. Sankey Diagrams

3. Word Clouds

4. Lollipop Charts

5. Radial Charts

6. Nested Bar Chart

The final dashboard can be viewed here. Additional information regarding


the dataset can be found here.

Note: Several of the visualizations utilize a field, Number of Records. Before


creating any visualizations, create a new field, Number of Records, and set the
value equal to 1. To view the dataset with all calculated fields, download the
dataset from the dashboard linked above, or download the dataset here.

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.

Image by Author: Initial Shark Tank US dataset loaded into Tableau

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.

Image by Author: Table Name column created after self-union

Step 2: Create New Fields & Bins


To develop this Sankey diagram, create seven calculated fields and one bin.
Open a new worksheet and create the following calculations. Note: Field
names listed in bold below, followed by the respective calculation.

1. ToPad: if [Table Name] = ‘Shark Tank US dataset’ then 1 else 49 end


2. Padded: Right click on the ToPad field and select Create → Bins to create a
new Bin called Padded. Set the Size of bins equal to 1.

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])

7. Curve: [Rank 1] + (([Rank 2]-[Rank 1])*[Sigmoid])

8. Deal Sizing: WINDOW_AVG(SUM([Number of Records]))

Note: Rank 2 is a duplicate of Rank 1

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.

Image by Author: Example creating bin, Padded, for sankey diagram


Step 3: Develop Sankey Visualization
Move t to the Columns shelf, Curve to the Rows shelf, and Padded to Detail on
the Marks card.

Image by Author: Add initial fields to worksheet for Sankey diagram

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

For Rank 1, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Pitchers Gender, Industry, Padded, Table


Name

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

For Rank 2, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Industry, Pitchers Gender, Padded, Table


Name

Ensure Industry is at the top, as this will be on the right of the Sankey
diagram
Image by Author: Rank 2 table calculations

For t, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Padded


Image by Author: t 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:

Select Compute Using Specific Dimensions

Check the following fields: Padded

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.

For the Y axis (Curve) change the range to start at 0.


Image by Author: Update y-axis range

For the X axis (t) change the range to -5 to 5.


Image by Author: Update x-axis range

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

Step 4: Create Ends of Sankey Diagram


The sankey diagram requires two bar charts, one for each end (Pitchers
Gender and Industry). Open a new worksheet, and create a bar chart. The
below image shows a bar chart for Pitchers Gender. Note: the color scheme
used for Pitchers Gender was used in the main portion of the Sankey diagram.
Image by Author: Bar chart displaying total number of deals by Pitchers Gender

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

Step 5: Add dashboard actions


Add the following dashboard actions to enable hovering capabilities for the
Sankey Diagram.

To add a dashboard action, from the main menu, select Dashboard → Actions
→ Add Action → Highlight.
Image by Author: Add dashboard action

For Pitchers Gender, add the following Highlight Action.


Image by Author: Create highlight action for Pitchers Gender

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

Create another highlight action for Industry. Again, select Dashboard →


Actions → Add Action → Highlight.

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 create a word cloud, one dimension (categorical variable) and one


measure (numerical variable) is required. This section shows how to
recreate the word cloud from the Shark Tank Deals dashboard. This word
cloud displays the number of deals within each industry.

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.

Image by Author: Change Mark Type on Tableau Worksheet

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!

Image by Author: Add Measure Values to Rows shelf

On the second Measure Values field, select Dual Axis.


Image by Author: Select Dual Axis on Measure Values field

Right click on one of the y axes, and select Synchronize Axis.


Image by Author: Synchronize chart axes

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

The following image shows the final lollipop chart.


Image by Author: Lollipop chart displaying number of deals by Shark

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.

Image by Author: Initial Shark Tank US dataset loaded into Tableau

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.

Image by Author: Table Name field created through Self-Union process

Step 2: Create New Fields & Bins


9 calculated fields and 1 bin is needed to create this radial chart. Open a new
worksheet and create the following calculations in order. Note: Field names
listed in bold below, followed by the respective calculation.

1. Path: IIF([Table Name] = ‘Shark Tank US dataset’, 0, 270)

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

4. Total Cat. Deals: WINDOW_SUM(SUM([Number of Records]))/2

5. Total Deals: WINDOW_SUM(SUM([Number of Records]))/2

6. Percent Calc: [Total Cat. Deals]/[Total Deals]

7. Rank Calc: RANK_UNIQUE([Total Cat. Deals], ‘asc’)

8. Size Calc: [Percent calc]/WINDOW_MAX([Percent calc])


9. X: SIN(RADIANS([Index-1])*[Size calc]) * [Rank calc]

10. Y: COS(RADIANS([Index-1])* [Size calc]) * [Rank calc]

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

Step 3: Create Visualization


Move Number of Sharks in Deal to the Colors tile on the Marks card, and
Path(bin) to the Rows shelf. Check Show Missing Values on the Path(bin)
field.
Image by Author: Check Show Missing Values

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

Move X to the Columns shelf, and Y to Rows shelf.


Image by Author: Add X & Y to Worksheet

Select Edit Table Calculation on Y.


Image by Author: Select Edit Table Calculation on Y

For Index-1, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: PATH(bin)


Image by Author: Index-1 table calculations

For Size calc, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal, PATH(bin)

Ensure Number of sharks in deal is at the top


Image by Author: Size calc table calculations

For Total Cat. Deals, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: PATH(bin)


Image by Author: Total Cat. Deals table calculations

For Total Deals, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal, PATH(bin)

Ensure Number of sharks in deal is at the top


Image by Author: Total Deals table calculations

For Rank calc, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal


Image by Author: Rank calc table calculations

Select Edit Table Calculation on X.


Image by Author: Select Edit Table Calculation on X

For Index-1, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: PATH(bin)


Image by Author: Index-1 table calculations

For Size calc, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal, PATH(bin)

Ensure Number of sharks in deal is at the top


Image by Author: Size calc table calculations

For Total Cat. Deals, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: PATH(bin)


Image by Author: Total Cat. Deals table calculations

For Total Deals, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal, PATH(bin)

Ensure Number of sharks in deal is at the top


Image by Author: Total Deals table calculations

For Rank calc, update the table calculation as follows:

Select Compute Using Specific Dimensions

Check the following fields: Number of sharks in deal


Image by Author: Rank calc table calculations

Once the table calculations are updated, the base of the radial chart begins
to take shape.
Image by Author: Radial Chart Base

Step 4: Additional Formatting


Use the Marks card to format the visual — adjusting line thickness, color, and
labels. The below image shows labels added to the beginning of each line,
and a new color palette assigned. Use the Format pane on the left to remove
borders and adjust the background as well.
Image by Author: Format radial chart

The following image shows the final radial chart.


Image by Author: Final radial chart

Nested Bar Chart


Another advanced visualization technique in Tableau is the nested bar chart.
A nested bar chart is a way of stacking bar charts that allows you to compare
two numerical values for a category. While this visualization type didn’t
make it to the final dashboard, the following example shows how to create a
nested bar chart using this data. The following nested bar chart displays the
number of deals and number of pitches by industry.

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

From the drop-down options on Got Deal, select Dual Axis.

Image by Author: Select Dual Axis

Right click one of the x-axes, and select Synchronize Axis.


Image by Author: Synchronize chart axes

On the All Marks card, change the type to Bar.

Image by Author: Change chart type to bar

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

And that covers 6 advanced visualizations in Tableau! While these examples


are in Tableau, keep in mind these visualizations can be created in other
tools as well — so use them as inspiration as you develop your next data
visualization!

The final dashboard is available here for viewing or downloading source


materials.

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)

Data Visualization Data Science Design Tableau Data Analytics


Written by Payal Patel Follow

330 Followers · Writer for Towards Data Science

Data & AI @ IBM | MS Analytics, NCSU | BS Information Science, UNC-CH

More from Payal Patel and Towards Data Science

Payal Patel in Towards Data Science Dominik Polzer in Towards Data Science

Data Visualization Generation 17 (Advanced) RAG Techniques to


Using Large Language and Image… Turn Your LLM App Prototype into…
An overview of the LIDA library, including how A collection of RAG techniques to help you
to get started, examples, and considerations… develop your RAG app into something robus…

Jun 25 164 2 Jun 26 1.8K 18


Mauro Di Pietro in Towards Data Science Payal Patel 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

Jun 28 695 11 Mar 2, 2022 566 3

See all from Payal Patel See all from Towards Data Science

Recommended from Medium


Bilikisu Olatunji Abhay Parashar in The Pythoneers

Maximize Your Business Potential 17 Mindblowing Python


with the Power of Data Analytics Automation Scripts I Use Everyday
In today’s data-driven world, businesses have Scripts That Increased My Productivity and
unprecedented access to vast information.… Performance

Jul 7 5d ago 2.6K 21

Lists

Stories to Help You Grow as a Predictive Modeling w/


Designer Python
11 stories · 837 saves 20 stories · 1373 saves

Interesting Design Topics Figma 101


257 stories · 647 saves 7 stories · 643 saves

Ed in Space Kavya in Python in Plain English

Building a terrain map 10 Best Tools for Web Scraping in


Revisiting this map, I wanted to document the 2024
layers for future reference. With the layers… Basics + comparison + tools and chrome
extensions

May 4 1 Jun 14 82
Bo Yuan, Ph.D. John Loewen, PhD in Data Storytelling Corner

Golden Methods to Visualize What is Your Data Story? How To


Skewed Data Make Sense Of Your Data
Key Techniques to Unveil Hidden Patterns in Transitioning from exploratory to explanatory
Clustered Data research

Jun 20 199 4 Jan 28 587 6

See more recommendations

You might also like