Converting single rows into multiple duplicate rows w/multiple columns

%3CLINGO-SUB%20id%3D%22lingo-sub-661225%22%20slang%3D%22en-US%22%3ERe%3A%20Converting%20single%20rows%20into%20multiple%20duplicate%20rows%20w%2Fmultiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-661225%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F352567%22%20target%3D%22_blank%22%3E%40thirdredwall%3C%2FA%3E%26nbsp%3B%2C%20that%20could%20be%20done%20with%20Power%20Query.%20Please%20check%20the%20sample%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-660737%22%20slang%3D%22en-US%22%3EConverting%20single%20rows%20into%20multiple%20duplicate%20rows%20w%2Fmultiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-660737%22%20slang%3D%22en-US%22%3E%3CP%3ENeed%20to%26nbsp%3Bconvert%20data%20for%20a%20single%26nbsp%3Bperson%20on%20one%20row%20with%20multiple%26nbsp%3Bcolumns%20into%20multiple%20rows%20for%20the%20same%20person%20plus%20each%20column%20of%20related%20data.%20Transpose%20does%20not%20work.%20Power%20Query%20might%20do%20the%20trick%2C%20but%20this%20is%20the%20first%20time%20using%20that%20tool.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20is%20much%20appreciated!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20sample%20data%20to%20start%20with%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20932px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F116724i9694AD480C8AD845%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Start%20Table.JPG%22%20title%3D%22Start%20Table.JPG%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExisting%20table%20of%20data%3C%2FSPAN%3E%3C%2FSPAN%3EConvert%20to%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20336px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F116725i5CBD6D94D62F896E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22End%20Table.JPG%22%20title%3D%22End%20Table.JPG%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFinal%20Result%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-660737%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20Query%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Need to convert data for a single person on one row with multiple columns into multiple rows for the same person plus each column of related data. Transpose does not work. Power Query might do the trick, but this is the first time using that tool.

 

Any help is much appreciated!

 

Here is the sample data to start with:

Existing table of dataExisting table of dataConvert to:

Final ResultFinal Result

5 Replies

@thirdredwall , that could be done with Power Query. Please check the sample attached.

So, how exactly did you accomplish this in Power Query? 

@melandiemcgee 

Not sure I understood the question. If check step by step queries in attached to previous post file, which of them are unclear?

Sorry. I don't have a background in Power Query. But I need to accomplish what you've done here. I see the query steps listed in the attachment but I don't know where to start to replicate what you've done. I guess I am looking for a step by step on the process--the details of what you did for each query step.

 

I have the data in an excel file and I know how to launch the power query editor. From there, I don't really know what to do. What I am looking to do is duplicate id's and create multiple rows for each test score (see attachment). This might be the wrong forum for that kind of assistance. If so, my apologies. But, any help you can provide would be appreciated.

@Sergei Baklan 

@melandiemcgee 

To work with Power Query you need to invest time to learn at least some basic things. That's not like with formulas where you may take the sample, change cell references and receive result. 

With your sample.

Power Query works with tables or named ranges. First is better, convert your data to structured table. Stay on any cell within, Ctrl+T and confirm

image.png

- next, stay on any cell within and query the table with Data -> From Sheet (or From Table/Range, depends on Excel version)

image.png

- Power Query editor will be opened. Select ID column, change type on Text and Unpivot other columns

image.png

- add two Index columns, one starting from 0, another from 1

- merge query wit itself on these columns

image.png

- expand only Value from resulting column

image.png

- filter Attribute column as

image.png

- remove indexes, rename columns and load result to Excel sheet

image.png