Select any cell in your crosstab, go to Data → From Table/Range and click OK to open it in the Power Query Editor. Power Query is built into Excel 2016 and later; in Excel 2016 the button is called From Table. Select the column or columns that label each row, such as the name or region, right-click one of their headers and choose Unpivot Other Columns.
Every other column, such as Jan to Dec, folds into two: Attribute, holding the old headers, and Value, holding the figures. Double-click each header to rename it, then click Home → Close & Load to send the result to a new sheet.
Unpivot Other Columns names only the columns you kept, for example = Table.UnpivotOtherColumns(Source, {"Region"}, "Attribute", "Value"), so a new month added to the source is picked up when you refresh with Data → Refresh All. Avoid Unpivot Only Selected Columns for data that grows, because it names each column and ignores any new one.
Power Query also adds a Changed Type step that names every original column. If a month column is later renamed or removed, refresh fails with The column 'Dec' of the table wasn't found. Delete that step before the unpivot and set the types after it instead: text for the month, a number type for the value.
Unpivot drops empty cells, so an item with a blank month disappears from the output for that month, which skews counts and averages. If you need those rows, select the month columns and use Transform → Replace Values to replace null with 0 before unpivoting.
Data in a crosstab form is good to use as a report because it’s easily understandable. But the problem occurs when you need to use it further.
In this situation, you need to put in some effort and spend your precious time to make it reusable. In the below example, you can see crosstab data. To make it reusable, the best way is to UNPIVOT it, yes, just like this one.

And to unpivot data, the best way is to use POWER QUERY. So today in this post, I’d like to share with you simple steps to convert crosstab data into a table using POWER QUERY’s unpivot option.
Steps to Unpivot Data in Excel with Power Query
Using Power Query for un-pivoting a data table is pure fun. You will be surprised at how easy it is. In Excel 2016 and later, and in Microsoft 365, it’s already there on the Data tab as “Get & Transform”. Only in Excel 2013 or 2010 do you need to install the Power Query add-in. Make sure to download this sample file to follow along.
- First of all, select your cross-tab data and go to the “Data Tab”.

- In the data tab, go to Get & Transform → From Table (in newer versions, it’s called From Table/Range).

- When you click on it, it will convert your crosstab data into an Excel table (if it isn’t one already).
- And it will instantly load the data into the Power Query editor.

- From here we need to select all the columns we want to unpivot.
- For this, select the Jan column, press and hold the Shift key, and select the Dec column.
- After that, right-click on it and select “Unpivot Columns”.

- Now, all 12 columns are unpivoted into two columns. One is for the month and one is for the amount.

- The last thing you need to do is to rename columns.
- For this, right-click on the column header, click Rename, and enter the new name (do it for both columns). You can also double-click the header.

- In the end, click on “Close and Load”.

Now your crosstab data is converted into simple data, and you can use it to create pivot tables and all other things for further analysis and sales reporting.

Unpivot Other Columns for Data That Grows
There’s one problem with selecting Jan to Dec and using “Unpivot Columns”. If you add a new column later (like a total or the months of the next year), it won’t be unpivoted when you refresh the query, because the step only remembers the columns you selected.
That’s why I prefer the other way round: select the columns that should stay as they are (like the product or region column), right-click and click “Unpivot Other Columns”. Now Power Query unpivots every other column, including the new ones you add later.
In the formula bar, you can see the difference. “Unpivot Other Columns” writes a step like the following, which names only the column that stays (here, Product):
= Table.UnpivotOtherColumns(#"Changed Type", {"Product"}, "Attribute", "Value")
Also, note that empty (null) cells don’t become rows when you unpivot. If you need a row for every month, replace the nulls with 0 first (Transform ➜ Replace Values).
Update the Unpivoted Data
Once the query is ready, you don’t need to repeat these steps. When you add or change data in the source table, just go to Data ➜ Refresh All (or right-click the output table and click Refresh), and Power Query unpivots the new data for you.
Conclusion
As I said, using Power Query is fun. It makes your unpivoting work so much easier that you don’t have to waste your time and effort.
Otherwise, if you go with manual methods, you don’t know how many times you need to cut-paste your data. Even if you use VBA, you need time to write code.
And Power Query is smart enough to understand the structure of your data.
I hope you found this method useful.
Now, tell me one thing. Have you ever tried to unpivot any kind of data? Which method have you used? And what do you think when you compare your method with Power Query? Share your views with me in the comment section, I would love to hear from you.
And please don’t forget to share this tip with your friends.
Frequently Asked Questions
How do I pivot the data back?
In the Power Query editor, select the column with the months, go to Transform ➜ Pivot Column, choose the amount column as the Values Column, and click OK.
What is the difference between Unpivot Columns and Unpivot Other Columns?
Both give the same result today. But Unpivot Other Columns names the columns that stay, so new columns added later are unpivoted on refresh too. Unpivot Only Selected Columns names the columns you selected, so new columns are left out.
Can I unpivot data without Power Query?
Excel has no built-in unpivot button outside Power Query. You can do it with formulas or VBA, but Power Query is the quickest way, and it refreshes with one click.
unpivot is wondeful, many thanks Puneet.
You’re Welcome.
Unpivot is THE BEST!!!
I dint get anything best in this…
Hi Puneet
Superb guide on how to unpivot data. Your explanation was very clear and easy to follow.
Many thanks.
Regards, Victor
Very useful as always.⭐⭐⭐⭐⭐???
I’m so glad you liked it. 🙂