0
votes

I have an Excel Table in the following format:

Code     Rank      MonthYr
 A        5        2018-10-01
 B        10       2018-10-01
 C        7        2018-10-01
 A        4        2018-11-01
 B        15       2018-11-01
 C        2        2018-11-01

I want to transform the table into the following format:

 Code     2018-10-01     2018-11-01
  A           5              4
  B           10             15
  C           7              2

I have tried the "Unpivot" features of PowerQuery but without success. Can this be done with PowerQuery?

1

1 Answers

3
votes

You should not use Unpivot, but Pivot for this. In Power Query Editor select MonthYr column and click Pivot Column, then select Rank as values column:

enter image description here

And you will get the desired result:

enter image description here