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
Power BI Show Ep 4 Post Show Carousel.jpg

The Power BI Community Show

Shabnam Watson demos Incremental refresh & Hybrid Tables and Leila Etaati demos Charticulator.

PBI April Release 2022 768x460.png

Check it out!

Click here to read more about the April 2022 updates!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!