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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors