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

Be 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

Reply
dearears
Helper I
Helper I

Table Transformation Columns to Rows

Hi All,

 

I have a table like so...

 

Material NameMaterial NumberMaterial TypeTransaction TypeProduction Order No
A1123456FinishedGoodProduction1001
R1R123RMConsumption1001
R2R124RMConsumption1001
R3R125RMConsumption1001
P1P121PMConsumption1001
P2P122PMConsumption1001
P3P123PMConsumption1001
Z1Z121RWConsumption1001
Z2Z122RWConsumption1001
A2245678SemiFinishedProduction2001
R4R126RMConsumption2001
R5R127RMConsumption2001
P4P125PMConsumption2001
P5P126PMConsumption2001

 

The table summarises by order number: goods produced (marked as Production under transaction type) and the ingredients consumed to product the good (marked as Consumption under transaction type). 

 

From this table I want to create another table or transfor this table to show the data as

 

Production Order NoProduction Mat NameProduction Mat NumberProduction Mat TypeIngredient NameIngredient NumberIngredient Type
1001A1123456FinishedGoodR1R123RM
1001A1123456FinishedGoodR2R124RM
1001A1123456FinishedGoodR3R125RM
1001A1123456FinishedGoodP1P121PM
1001A1123456FinishedGoodP2P122PM
1001A1123456FinishedGoodP3P123PM
1001A1123456FinishedGoodZ1Z121RW
1001A1123456FinishedGoodZ2Z122RW
2001A2245678SemiFinishedR4R126RM
2001A2245678SemiFinishedR5R127RM
2001A2245678SemiFinishedP4P125PM
2001A2245678SemiFinishedP5P126PM

 

Can someone guide me on how this can be done?

 

Thanks in advance.

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@dearears I did it with Power Query.
Link to download the file with the solution: Table Transformation Columns to Rows.pbix


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

3 REPLIES 3
SpartaBI
Community Champion
Community Champion

@dearears I did it with Power Query.
Link to download the file with the solution: Table Transformation Columns to Rows.pbix


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Thank you ! Works like a charm and your logic is very clear and straight forward.

@dearears my pleasure 🙂
Hey, check out my showcase report - got some high level stuff there 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.