Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors