Tableau Lesson 15 – Pivoting Data | Dataplexa
Section II — Lesson 15

Pivoting Data in Tableau

Pivot reshapes wide, column-heavy data into the tall, row-based format that Tableau needs to analyse and visualise it correctly — turning many separate columns into two clean fields.

The Wide vs Tall Problem

Many datasets — especially those built in Excel — are structured for human reading rather than machine analysis. A typical example is a monthly sales report where each month is its own column: Jan, Feb, Mar, Apr, and so on across 12 columns. This is called wide format.

Tableau works best with tall format — where each row represents one observation. In tall format, those 12 month columns become two fields: a Month field (containing the month name) and a Sales field (containing the value). Instead of 1 row with 12 values, you have 12 rows with 1 value each. This structure lets Tableau plot, filter, aggregate, and sort the data correctly.

Wide Format — Hard for Tableau
Region Jan Feb Mar
East4,2003,8005,100
West3,6004,1003,900
Tall Format — Tableau Ready
Region Month Sales
EastJan4,200
EastFeb3,800
EastMar5,100
WestJan3,600
WestFeb4,100
WestMar3,900

Pivoting on the Data Source Tab — Step by Step

Tableau's built-in pivot tool lives on the Data Source tab. You select the columns you want to collapse, right-click, and pivot — no formulas required.

1
Connect to your data source and open the Data Source tab. The wide table appears in the data preview at the bottom — you can see columns like Jan, Feb, Mar laid out side by side.
2
Click the header of the first column you want to pivot — Jan. Then hold Shift and click the last column — Dec — to select all 12 month columns at once. They highlight in blue.
3
Right-click any of the selected column headers and choose Pivot. Tableau immediately collapses the 12 columns into two new columns: Pivot Field Names and Pivot Field Values.
4
Double-click Pivot Field Names and rename it Month. Double-click Pivot Field Values and rename it Sales. Click Sheet 1 — your tall-format data is ready to use.

Data Source Tab — Pivot Mockup

Data Source Tab — Before and After Pivot
Before — Wide (12 month columns selected)
Region
Jan
Feb
Mar
Apr
… Dec
RIGHT-CLICK → Pivot
After — Tall (two new columns)
Region
Month
(Pivot Field Names)
Sales
(Pivot Field Values)

What Changes in the Data Pane After a Pivot

Once the pivot is applied, the Data pane reflects the new structure. The 12 individual month fields are gone — replaced by two fields: the Dimension Month (containing the names Jan through Dec) and the Measure Sales (containing the numeric values). Every worksheet in the workbook now works with this reshaped structure.

To undo a pivot, go back to the Data Source tab, right-click either of the two pivoted columns, and select Remove Pivot. The original wide columns are restored.

Pivot Field Names and Values — Renamed and In Use

Worksheet — Sales by Month After Pivot
Columns: Month
Rows: SUM(Sales)
Jan
Feb
Mar
Apr
May
Jun
Month on Columns · SUM(Sales) on Rows — only possible after pivot reshapes the data

When to Pivot vs Fix the Source

Tableau's pivot tool is applied at connection time and updates automatically when the source data refreshes. It is the right choice when you do not control the source file and cannot change its structure. If you do own the source, restructuring it in Excel or Tableau Prep before connecting will produce a cleaner, more flexible result — especially for large datasets where pivot performance can slow down extracts.

Situation Recommended approach
You receive a new wide Excel file each month that you cannot modify Use Tableau's built-in pivot on the Data Source tab
You own the source and the dataset is large Reshape in Tableau Prep or Excel before connecting
The wide columns to pivot are not contiguous or have inconsistent names Use Tableau Prep's pivot step — it offers more control than the Data Source tab pivot
📌 Teacher's Note

Wide data is the single most common structural problem beginners encounter when connecting real-world Excel files to Tableau. The symptom is always the same: you want to plot something over time but Tableau sees months as separate Measure fields instead of values in a single Dimension. The moment you recognise a dataset where each column is a time period or a category variant, reach for the pivot tool immediately. Two clicks on the Data Source tab and your data is in the shape Tableau expects. Do not try to work around wide data using calculated fields — fix the structure first, then build your analysis.

Practice Questions

1. After applying a pivot on the Data Source tab, what are the default names Tableau gives to the two new columns it creates?

2. How do you undo a pivot that has already been applied on the Data Source tab?

3. What is the name of the data structure — where each row represents one observation — that Tableau works best with?

Quiz

1. A dataset has a Region column and 12 separate monthly Sales columns — Jan through Dec. What is the correct way to reshape this into tall format in Tableau?


2. What happens to the 12 monthly Sales columns in the Data pane after the pivot is applied?


3. When should you use Tableau Prep's pivot step instead of the Data Source tab pivot?


Next up — Lesson 16: Splitting fields — breaking a single text field into multiple columns using Tableau's automatic and custom split tools.