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
Neil_Cooper
Helper I
Helper I

Rearranging survey data to from columns to rows

Hi Everyone

 

I wonder if you can help?  I have survey data I am trying to organise into a table showing the top 3 areas and the bottom 3 areas (based on average scores for each question) in separate tables.  Whilst this in theory sounds easy enough I am finding that as these are on separate columns in the example below I am finding this doesnt work in Power BI for two reasons.  Firstly it brings the ratings into the rows and secondly the top N cannot be used as these are all separate columns.

 

Neil_Cooper_0-1598441419694.png

 

What I need is this:

Neil_Cooper_1-1598441588463.png

 

I wonder if there is a way of reorganising the data in Power BI to achieve this.  

 

Hope this makes sense and many thanks in advance 🙂

 

Best wishes

 

Neil 

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

In the query editor, highlight your first two columns, and right click and choose Unpivot Other Columns.  Load that table, and you can make a table or matrix to get your result with the Attribute column (or whatever you rename it to) and the average of the Value column.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Employee
Employee

In the query editor, highlight your first two columns, and right click and choose Unpivot Other Columns.  Load that table, and you can make a table or matrix to get your result with the Attribute column (or whatever you rename it to) and the average of the Value column.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you so much!  This is genius 😊  I would have not figured this out on my own so thank you so much.  It's so simple and did just the trick!  Really appreciate it, your a lifesaver!

My apologies if this wasn't clear it is a tricky one to explain.  Really appreciate you sending the response over.  I was able to use the unpivot other columns and then use the attritubes to get the results I needed.

 

Best wishes

 

Neil

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.