Forum Discussion
Pivot/Unpivot Power Query
Hi,
In my opinion its always better to transform the input table to row level and use visuals to get de desired result. I made a sample .pbix with both the transformation to row level and the desired table. U can download the file here: https://we.tl/t-PfxLo5Av6T.
To get to the row level I first Transposed the table. Then I removed 'Sales' from the year column (not necessary). Ater that I Promoted the first row to headers and renamed them. After that I selected the product columns and unpivoted them to get to row level ('Convert to Rows' table in file). Within the report I made a Matix that shows the desired result.
To get the result using Power Query after the row level there is one more stap ('Option 2' table in file). That is to select the Year column and then choose Pivot and select 'sales' as Value Column. By default the Aggregate function is SUM.
Hope this is useful.
Gr,
Jesse