Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
iharriague
Regular Visitor

Converting one table with mixed column and row data into 2 separate tables

I would like to please convert the orignal data table as shown below into 2 separate data tables.

I hope you can please me a hand, I am clueless on how to proceed.
I color coded the columns names for convenience.
The original talbe is built by importing excel wookbooks with 3 sheets each.

Thank you.

2023-06-20 23_18_07-Book1 - Excel.png

3 REPLIES 3
edhans
Super User
Super User

This looks relatively simple.

First just transpose the first table and promote the headers, and remove any nulls.

Then add Table1 and Table2 as a crossjoin. This is what I got. I didn't type in all the data. Just the first stuff. The rest is just repeating and possibly appending later with Table.Combine (in the Merge menu, Append.

 

edhans_0-1687305060563.png

For the first green table, New Table 1, here is what I did.

edhans_1-1687305176956.png

  1. New Table 1 starts as a reference of Table 1.
  2. Added a new Custom Column
  3. The formula is simply = Table 2. 

Then just expand all columns.

 

Here is my file. I did it all in Excel for ease of use, and didn't use multiple sheets. If you need more help, provide sample data per below.

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hello @edhans 
I have saved sample data and .pbix file - see here.
My target:
The <Input> files will be transfromed into 2 data tables so that they replicate the <Output> excels' format.
Get data is from a folder where the Input worksheets are stored, new ones are saved periodically.

End goal:
Once the data is clean I will be able to create 2 matrix (side by side) and for example understand the changes between data table 1 released x months ago, and the latest one for Model Y and Part 100.

Thank you.
LogicLogic

Dear edhans,
Thank you for your immediate reply.
I believe I oversimplified my question.
I will provide sample data to better explain the concern.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.