How to Pivot Your Data in Tableau
Updated: May 10
When connecting to data in Tableau, your data should include a data column instead of a column for each date or year. For this reason, Tableau has a pivot feature. Pivoting in Tableau is easy. Here's how.
In this example I'm going to show you how to use data like this in Tableau. Sometimes in excel you have a separate column for each year. I'm showing regional sales for 2018, 2019, and 2020. When you use this in tableau it can cause problems so what we're going to do i...
1. Connect to our data which we have already done and we'll see that we have a column for region 2018, 2019, and 2020.
2. What you want to do if your data is formatted like this is pivot your columns similar to a pivot table in excel. Tableau prefers one date column instead of three year columns
3. So I'm going to do is highlight each one of these years click a drop down transform and pivot. This is going to remove each year column and replace it with a pivot field name and a pivot field value
4. I'm going to rename pivot field names to date and pivot field values to sales; and I'll make the date into a date format
5. Now I can use the two fields in Tableau like normal
If pivoting doesn't solve your problem, you may want to try scaffolding your data with Tableau.