Forum Discussion

Sunce's avatar
Sunce
New Member
4 years ago
Solved

How to rearrange data in power query

I have a data sample from excel that is in the following format:

 

 

NameColumn 2Column 3Column 4Column 5
HarryPigNullNullNull
JamesApple PieCatTom FordFerrari
StellaDogGucciLasagna 
MichealCorollaNullFendiGoat Curry

 

How do i rearrange this data set into the following format in power query. Assuming the names are all unique values.

NamePetFavourite_FoodFavourite_DesignerCar
JamesCatApple PieTom FordFerrari
StellaDogLasagnaGucci 
HarryPigNullNull 
MicheaLNullGoat CurryFendiCorolla
  • You'll need to create a translation table so you can look up an item and figure out the category (car, pet, designer, food).  Then it's a matter of unpivoting; joining; and pivoting to get your desired output.

1 Reply

  • You'll need to create a translation table so you can look up an item and figure out the category (car, pet, designer, food).  Then it's a matter of unpivoting; joining; and pivoting to get your desired output.