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

Convert excel matrix table to flattened table

The Excel tables that I receive for import into Power BI always have data arranged as a matrix.

 

Where is a good place that I can learn how to convert a matrix into a flattened table?

 

I've found this very difficult to learn.

 

Transpose, Pivot, Unpivot just seem to mess up the arrangement that I'm seeking ie one column per common variable.

 

Here's an example of the type of data that I receive:

image.pngColumns C to H have subcategories.

 

 

I have an active question about how to convert this to a flattened table if you wish to contribute.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Convert excel matrix table to flattened table

Hi,

 

Instead of having 2 rows for every column, have just one.  So row 2 should have Year, DHB, Maori - Enrolled, Maori - Populaiton etc.  Once that is done, take the data to the Query Editor, right click on the first 2 columns and select Unpivot other columns.  You may then split the attribute column by the - delimiter.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: Convert excel matrix table to flattened table

In edit query, select first two columns and then right click and then "unpivot other columns"

 

you will get attribute and value, attribute will be your category c to h and value.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Re: Convert excel matrix table to flattened table

Thanks for your reply @parry2k

 

When I pasted the image above I'd left out row 1. I've now pasted the correct image.

 

Note that rows C-D, E-F, and G-H are categories, and nested below those population groups are the variables Enrolled, Population.

 

So I'd like to end up with a flattened table that has the columns:

Year - DHB - Group - Enrolled - Population

 

Group would be the columns I mentioned above ie Maori, Pacific, Other.

 

Any advice on how I'd go about this?

Highlighted
Super User IV
Super User IV

Re: Convert excel matrix table to flattened table

Hi,

 

Instead of having 2 rows for every column, have just one.  So row 2 should have Year, DHB, Maori - Enrolled, Maori - Populaiton etc.  Once that is done, take the data to the Query Editor, right click on the first 2 columns and select Unpivot other columns.  You may then split the attribute column by the - delimiter.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Re: Convert excel matrix table to flattened table

@Ashish_Mathur You Sir, are a legend!!! OMG your solution worked! Thank you soooooooooo much!

You’re a Power BI Expert!!! Best wishes!
Super User IV
Super User IV

Re: Convert excel matrix table to flattened table

You are most welcome.  I am just a learner like you.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors