How to pivot multiple measures and columns in Power Query and Power BI

The pivot-function in Power Query lets you pivot your data within the query already. This comes in handy quite often when you want to further work on those results within the query. There’s not much to parametrise in the function, so the question is how to handle it when you want more than one measure/value to be returned.
Let’s say you have a table like this:

Ausgangstabelle

And it shall look like this:

02_Ziel

You first unpivot your measure columns:

Schritt1

Resulting in this:

Schritt2

Now merge Product & Attribute in order to create your new header column:

MergeNew

On this new column you now perform your new pivot operation:

NewPivot

& voilà: Pivot multiple measures in Power Query and Power BI:

Zieltabelle

You can download the file: Pivot multiple columns

Enjoy & stay queryious 🙂

Leave a Reply