Tableau Course
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.
| Region | Jan | Feb | Mar |
|---|---|---|---|
| East | 4,200 | 3,800 | 5,100 |
| West | 3,600 | 4,100 | 3,900 |
| Region | Month | Sales |
|---|---|---|
| East | Jan | 4,200 |
| East | Feb | 3,800 |
| East | Mar | 5,100 |
| West | Jan | 3,600 |
| West | Feb | 4,100 |
| West | Mar | 3,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.
Data Source Tab — Pivot Mockup
(Pivot Field Names)
(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
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 |
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.