March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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:
I have an active question about how to convert this to a flattened table if you wish to contribute.
Solved! Go to Solution.
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.
Hi,
I have a similar query with the data but wanted to automate the process as I receive daily data which needs to be updated. How can I query this?
and wanted to transform it into the following way:
Hi,
Your input data is in very bad shape. It may take a lot of effort to get it in your desired format. It may not be an easy task.
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.
You are most welcome. I am just a learner like you. If my reply helped, please mark it as Answer.
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.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |