How to Pivot Columns in Tableau

While creating reports in Tableau, I get the data that is divided into multiple columns, for example, separate columns for sales, profit, or different time periods.

In Tableau, reports are better structured when the data is in a long format. In this format, one column defines the type, such as Month or Measure, and another column contains the corresponding values.

To convert such data into long format, we can use Tableau’s pivot feature to group it.

In this Tableau tutorial, I’ll explain how to pivot data in Tableau. In this, we will see two common use cases: pivoting measures and pivoting time-based data.

What “Pivot Columns” Means in Tableau

When I say “pivot columns in Tableau,” I’m talking about reshaping your data so it’s easier to analyze and build charts from.

There are two main scenarios:

  • Columns to rows (unpivot): You have many similar columns (Jan, Feb, Mar…) and you want to stack them into a single column (Month) with another column for values (Sales). This is the most common pivot in Tableau Desktop.
  • Rows to columns: You have “tall” data (one row per combination of dimension and value), and you want separate columns for each category (for example, separate columns for each order status). This is usually done in Tableau Prep or via other tools before data reaches Desktop.

Why You Should Pivot Columns in Tableau

Let me quickly explain why pivoting is worth your time. In most real‑world data, you’ll see structures like this:

  • One column per month (Jan, Feb, Mar…)
  • One column per survey question (Q1, Q2, Q3…)
  • One column per product or region (Product A, Product B…)

This layout is convenient in Excel, but it’s not great for Tableau. It usually causes issues like:

  • You struggle to build flexible charts because each month or question is a separate field.
  • You can’t easily add a filter for “Month” or “Question” because that concept isn’t a single field.
  • You need lots of manual steps (multiple calculated fields, manual color assignments, etc.).

After pivoting:

  • You get one column that represents the category (Month, Question, Region…).
  • You get one column that represents the value (Sales, Response, Amount…).
  • Your data becomes “tidy,” and most Tableau visuals become much easier to build.

So if you ever feel like you have “too many similar columns,” pivoting is usually the fix.

Create Pivot Tables in Tableau

In the examples below, we will create the pivot tables in Tableau. In these, we will see how to pivot fields for measures, and then pivot values for time-based columns such as Year, Month, and Quarter.

Create a Pivot Table for Measure Columns in Tableau

In this example, we will pivot the measure columns like Sales, Profit, and Discount from the Tableau Superstore dataset.

Now, connect Tableau with the Superstore dataset and follow the steps below.

  1. After establishing the connection to the dataset, click the Data source tab.
  1. In the Data Source, we will see the data table. Here, press “Ctrl” and select the Measures that you want to pivot. In this example, we will pivot the Sales, Profit, and Discount.
  1. Right-click on one of the selected headers and select Pivot.