cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danielrsnyder
Frequent Visitor

Transform data from rows to columns when the column headers repeat?

I have data that comes out as shown below (Raw Data), however, all of the ratings are listed in rows based on the individual/customer record they are on. I want each rating to be under the first set of columns (Desired Output). Any ideas? Thanks in advance.

 

Raw Data

Customer IDRating Unique IDRating Added ByDate AddedDate Last ChangedLast Changed By Source Category DescriptionRating Unique ID_1Rating Added By_1Date Added_1Date Last Changed_1Last Changed By_1 Source_1 Category_1 Description_1
100001-592-0000172109dsnyder11/20/201511/20/2018dsnyderFake Source AFake Rating AFake Description AWP_18423_11dsnyder11/20/201511/20/2018dsnyderFake Source AFake Rating AFake Description A
200001-592-0000127359dsnyder4/1/20145/10/2019dsnyderFake Source BFake Rating BFake Description BWP_24657_11dsnyder7/2/201411/12/2018dsnyderFake Source BFake Rating BFake Description B
300001-592-0000126441dsnyder10/7/20135/10/2019dsnyderFake Source AFake Rating AFake Description CWP_24773_11dsnyder7/2/20148/22/2018dsnyderFake Source AFake Rating AFake Description C
400001-592-0000172098dsnyder11/19/20152/19/2019dsnyderFake Source BFake Rating BFake Description AWP_2956_19dsnyder3/2/20162/19/2019dsnyderFake Source BFake Rating BFake Description A
500001-592-0000172130dsnyder11/24/20152/20/2019dsnyderFake Source AFake Rating AFake Description BWP_5392_19dsnyder3/2/20162/20/2019dsnyderFake Source AFake Rating AFake Description B
600001-592-0000172096dsnyder11/19/20158/9/2018dsnyderFake Source BFake Rating BFake Description Cnullnullnullnullnullnullnullnull
700001-592-0000172116dsnyder11/20/20158/29/2018dsnyderFake Source AFake Rating AFake Description Anullnullnullnullnullnullnullnull

 

Desired Output

Customer IDRating Unique IDRating Added ByDate AddedDate Last ChangedLast Changed By Source Category Description
100001-592-0000172109dsnyder11/20/201511/20/2018dsnyderFake Source AFake Rating AFake Description A
200001-592-0000127359dsnyder4/1/20145/10/2019dsnyderFake Source BFake Rating BFake Description B
300001-592-0000126441dsnyder10/7/20135/10/2019dsnyderFake Source AFake Rating AFake Description C
400001-592-0000172098dsnyder11/19/20152/19/2019dsnyderFake Source BFake Rating BFake Description A
500001-592-0000172130dsnyder11/24/20152/20/2019dsnyderFake Source AFake Rating AFake Description B
600001-592-0000172096dsnyder11/19/20158/9/2018dsnyderFake Source BFake Rating BFake Description C
700001-592-0000172116dsnyder11/20/20158/29/2018dsnyderFake Source AFake Rating AFake Description A
1WP_18423_11dsnyder11/20/201511/20/2018dsnyderFake Source AFake Rating AFake Description A
2WP_24657_11dsnyder7/2/201411/12/2018dsnyderFake Source BFake Rating BFake Description B
3WP_24773_11dsnyder7/2/20148/22/2018dsnyderFake Source AFake Rating AFake Description C
4WP_2956_19dsnyder3/2/20162/19/2019dsnyderFake Source BFake Rating BFake Description A
5WP_5392_19dsnyder3/2/20162/20/2019dsnyderFake Source AFake Rating AFake Description B
6nullnullnullnullnullnullnullnull
7nullnullnullnullnullnullnullnull
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Take a look at the attached file. Basically just split the table and then append back into itself

Transform data from rows to columns when the column headers repeat.pngFile:

https://1drv.ms/u/s!Amqd8ArUSwDS3SCb8a1zPqvlVyuP?e=1mD04A

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Take a look at the attached file. Basically just split the table and then append back into itself

Transform data from rows to columns when the column headers repeat.pngFile:

https://1drv.ms/u/s!Amqd8ArUSwDS3SCb8a1zPqvlVyuP?e=1mD04A

Thanks @Anonymous, that works beautifully!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!