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
powebibeginner
New Member

Merging duplicate column ID's and placing specific column as a row

Hi, i have been struggling with how to get this working. I tried merging/grouping/transposing, but i dont seem to be doing it right.

 

I have a list of students with grades for different subjects:

IDFirst NameLast NameSubjectGrade
1JohnSmithMath8
1JohnSmithScience9
1JohnSmithEnglish10
1JohnSmithSocial Studies9
2SteveNashMath6
2SteveNashScience7
2SteveNashEnglish8
2SteveNashSocial Studies4
3JamalMurrayMath2
3JamalMurrayScience3
3JamalMurrayEnglish9
3JamalMurraySocial Studies4
4KellyOlynkMath7
4KellyOlynkScience6
4KellyOlynkEnglish8
4KellyOlynkSocial Studies2

 

I want to merge the students all into one row with the addition of the subjects to the headers:

 

IDFirst NameLast NameMathScienceEnglishSocial Studies
1JohnSmith89109
2SteveNash6784
3JamalMurray2394
4KellyOlynk7682

 

Any help or advice would be appreciated.


Thank you

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

=Table.Pivot(PreviousStepName,List.Distinct(PreviousStepName[Subject]),"Subject","Grade")

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

=Table.Pivot(PreviousStepName,List.Distinct(PreviousStepName[Subject]),"Subject","Grade")

Thanks! worked for me!

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