Transpose or unpivot (?) with conditions

arake

New Member
Joined
Jun 4, 2021
Messages
2
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi!

Can you please help me out with a transpose/unpivot problem ? ?
On top of being a total newb in power query, English is not my native language, so i'll try and do my best to be as clear as possible.

So, I've gone this far in "cleaning" an extract i've got from a survey about drinks purchasing habits. Problem is it all came into columns like that :
Image1.png


An ID corresponds to a person who has bought a particular category of drinks (Beers, fruit juices, etc.). For each category of drinks the person purchased, he/she is asked to detail the brand as well as the format, the packaging it came in, and so on.

From that, i'm trying to transpose the items in the "Custom" column into their own column, while keeping the corresponding data in the "Valeur" column, like so :

Image3.png


Can you help me out with that please ? What steps would you take to do it ?

Thank you very much for your help
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Below is your sample data as an XL2BB it might help get you a response.

20210605 PQ Transpose.xlsx
ABCD
1IDCustomValeur
21CATEGORYAucune
32CATEGORYPUR JUS DE FRUITS
42BRANDORO
52FORMATBOUTEILLE SOCL
62PACKAGING1x
72ON SALENon
82CONSUMERPour vous
92PLACEDiscounter (Leader Price, Discount)
102CATEGORYCOLAS
112BRANDCOCA COLA
122FORMATBOITE 25CL
132PACKAGING1x
142ON SALEnon
152CONSUMERPour vous
162PLACEDiscounter (Leader Price. Discount)
173CATEGORYAucune
184CATEGORYBIERE
194BRANDNUMBER ONE
204FORMATBOITE 33CL
214PACKAGING12x
224ON SALENon
234CONSUMERPour vous
244PLACEPetits magasins alimentaires
254BRANDNUMBER ONE
264FORMATBOUTEILLE 33CL
274PACKAGING8x
284ON SALENon
294CONSUMERPour vous
304PLACEPetits magasins alimentaires
314BRANDNUMBER ONE
324FORMATBOITE 50cl
334PACKAGING24x
344ON SALENon
354CONSUMERPour vous
364PLACEPetits magasins alimentaires
37
Data
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top