cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

How to unpivot and pivot multiple columns into their own groups with their respective rows?

I have a table in this structure (from a SharePoint List):

Row IDDateEvaluator NameQuestion 1Question 2Question 3Question 1 CommentsQuestion 2 CommentsQuestion 3 CommentsQuestion 1 PointQuestion 2 PointQuestion 3 PointQuestion 1 Missed ReasonsQuestion 2 Missed ReasonsQuestion 3 Missed Reasons
19/18/2020JakeGoodBadGoodComments hereComments hereComments here313Reason 1, Reason 2Reason 2Reason 2, Reason 4
29/19/2020MaryBadGoodGoodComments hereComments hereComments here133Reason 1Reason 2Reason 3
39/23/2020WilliamNeutralNeutralGoodComments hereComments hereComments here223Reason 2Reason 2Reason 2
49/23/2020JakeBadGoodBadComments hereComments hereComments here131Reason 3, Reason 4Reason 4Reason 1

 

 

I'd like to transform it (unpivot, pivot, etc.) to obtain this result (for example):

 

Row IDDateEvaluator NameQuestionResponseCommentsPointsMissed Reasons
   Question 1GoodQuestion 1 Comments  
   Question 1    
   Question 1    

 

Basically, I'd like to group all the question columns, comments columns, points columns, and reason columns into their own respective columns with the corresponding rows.

 

Is there a way to transform my data to get that end result?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

You will need to find the delimiter between Question 1 and Comments, Points, etc.

For example, if you have Question 1: Comments
Question 1: Points
Question 1: Missed Reasons

If you don't have that delimiter, you can use a conditional column to look for text that contains Missed Reasons, Point, Comments and use that to determine which part of the question it answers.

Please see the attached file for reference. I will upload it under the signature.

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

1 REPLY 1
Super User II
Super User II

You will need to find the delimiter between Question 1 and Comments, Points, etc.

For example, if you have Question 1: Comments
Question 1: Points
Question 1: Missed Reasons

If you don't have that delimiter, you can use a conditional column to look for text that contains Missed Reasons, Point, Comments and use that to determine which part of the question it answers.

Please see the attached file for reference. I will upload it under the signature.

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors