Forum

Power Query - Unpiv...
 
Notifications
Clear all

Power Query - Unpivoting an Unpivot?

5 Posts
2 Users
0 Reactions
71 Views
 budu
(@budusegbe)
Posts: 3
Active Member
Topic starter
 

Hi,

Maybe someone can help me.

I extracted and transformed a source table using Power Query up to the point where the table looks as below:

Pre-1.JPG

Col A contains the main ID & are in duplicate only because of multiple values in the corresponding Col B. On the face of it, it looks like an 'unpivot table'. However I want my target load table to look something like this:

Post.JPG

In essence Col A to contain unique IDs with only the 1st 2 corresponding values from Col B aligned as new columns C & D on the same row.

I have tried different unpivoting, transposing, pivot, grouping, but no luck! 🙁

Can anyone help me? I am at loss...

Much appreciate any suggested help, assistance, pointers

Thanks

 
Posted : 01/07/2017 2:43 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Budu,

Please see the file attached.

Mynda

 
Posted : 01/07/2017 7:15 am
 budu
(@budusegbe)
Posts: 3
Active Member
Topic starter
 

Hi Mynda,

Great thanks! Smile

I also posted the same problem on the Power Bi Community forum (check following link):

http://community.powerbi.com/t5/Desktop/Power-Query-unpivoting-an-Unpivot/m-p/203292

I find your solution a much simpler & efficient use of the functionalities of Power Query. The offered solution in the community forum involved the tweaking of the associated M language.

I have learnt two things: 1) there are more than one ways of finding a workable solution to a problem - as with everything else besides Excel! 2) I need to stop ignoring the benefit of using the Index Column feature Smile

Again, many thanks

 
Posted : 02/07/2017 4:26 am
(@mynda)
Posts: 4761
Member Admin
 

You're welcome, Budu. You're absolutely right about 1 and 2 🙂

Just note for future, if you post your question on multiple forums then it is forum etiquette to be up front about that. People are giving up their time to help for free and they don't take kindly to duplicating effort. No harm done this time, but you don't want to burn your bridges 🙂

Mynda

 
Posted : 04/07/2017 6:49 am
 budu
(@budusegbe)
Posts: 3
Active Member
Topic starter
 

Thanks for the heads up. It wasn't intended really 🙂

 
Posted : 06/08/2017 1:20 pm
Share: