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
MickThurman
Frequent Visitor

Transposing data

Hi, I have a table which is a long list of materials, some of which are duplicates - in that they are the same material but with a different number. Fortunately, as can be seen in the picuture, these materials can identified through cross referencing the details in the 'Old material number' and 'Legacy Material Number' columns. To aid some downstram modelling we need to do, ideally what I would like to do is stack these two records up side by side - possibly in another table? - with the 'SC???????' material (and its associated data elements) to the right of the ?????/???? material.

 

Any thoughts on how to do this would be much appreciated?

 

MickPBI MARC.PNG 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @MickThurman 

You can try merge function in power query editor.

Firstly we need to duplicate this table in power query editor.

1.png

Keep first top row in Table(2)

2.png

Then merge Table (2) and Table by Old material number column in Table(2) and Legacy Material Number column in Table.

3.png

Final expand all rows in Table.

Result is as below.

4.png5.png

All elements will show in one row.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

6 REPLIES 6
v-rzhou-msft
Community Support
Community Support

Hi @MickThurman 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

v-rzhou-msft
Community Support
Community Support

Hi @MickThurman 

You can try merge function in power query editor.

Firstly we need to duplicate this table in power query editor.

1.png

Keep first top row in Table(2)

2.png

Then merge Table (2) and Table by Old material number column in Table(2) and Legacy Material Number column in Table.

3.png

Final expand all rows in Table.

Result is as below.

4.png5.png

All elements will show in one row.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

fhill
Resident Rockstar
Resident Rockstar

 

Speaking just in theory, as we'll need more sample data to really help step by step.  Here's one idea....

* Copy this table to a new table

* Filter rows to remove any row with a Legacy Value

* Perform a Lookup in a new column, matching Old Material Number to the (Original Table) Legacy Material Column

* Return from the Lookup whatever values you need?




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




vanessafvg
Super User
Super User

so you want one row, but to keep all the legacy attributes but in one row, is that what you are saying?  how will you be using this data?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi, Yes one row, for these data. Will be using the data against a raft other attributes from other tables to manage their consolidation.

 

Greg_Deckler
Super User
Super User

@MickThurman - Not entirely sure what you want as output. Can you provide an example. There is a transpose function in Power Query and I wrote a DAX solution for transpose as well. TRANSPOSE (powerbi.com)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.