How to Unpivot Data in Excel using Power Query

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 some efforts and spend your precious time to make it re-usable.

In the below example, you can see a crosstab data.

To make it re-usable 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 a crosstab data to into table using POWER QUERY’s unpivot option.

Steps to Unpivot Data in Excel with Power Query

  • First of all, select your cross-tab data and go to “Data Tab”.
  • In data tab, go toGet & Transform → From Table.
  • When you click on it, it will convert your crosstab data into an Excel table (If already not).
  • And, it will instantly it will load data into power query editor.
  • From here we need to select all the columns we want to unpivot.
  • For this, select Jan column and press and hold the shift key and select Dec column.
  • After that, right-click on it and select “Unpivot Columns”.
  • Now, all the 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 and rename it (for both).
  • In the end, click on “Close and load”.

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

Conclusion

As I said using power query is a fun. It makes your unpivoting work so easier that you don’t have to waste your time and efforts.

Other wise if you go with manual methods you I don’t know how many time you need to cut-paste your data. Even if you use VBA, you need time to write code.

And, power query is smartenogh 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 you have used? And, what do you think while comparing 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.

You must Read this Next

  1. Convert a Formula to Value: Sometimes it’s important to change a formula into its result value and I’ve found that...
  2. VLOOKUP in Power Query: Using Power Query to replace VLOOKUP is not just easy but fast and the best part is...
  3. Concatenate a Range of Cells: You need to select all the cells of a range one by one. And, if you try to refer...
  4. Convert Negative Number into Positive: Have you ever checked how my different methods you have to do this? Well, I am always curious...
  5. Calculate SQUARE ROOT in Excel: Using power query for square root is a dynamic method, every time when you enter a new value...
  6. Convert a Formula to Value in Excel: Just think this way, when you send a report to someone, they are not concerned with formulas...
  7. Get Month from a Date: A month is one of the useful components of a date which you can use to summarize data...

Content Protection by DMCA.com
2018-08-31T11:14:45+00:00
  • Oz says:

    Unpivot is THE BEST!!!

    • VIRU says:

      I dint get anything best in this…

  • Victor says:

    Hi Puneet
    Superb guide on how to unpivot data. Your explanation was very clear and easy to follow.
    Many thanks.
    Regards, Victor

  • Sayed says:

    Very useful as always.⭐⭐⭐⭐⭐???

    • Puneet Gogia says:

      I’m so glad you liked it. 🙂

  • >