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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Jagen007
Regular Visitor

How to transpose column value into header

Greeting

This is my table design is as below.

Order No.MaterialDelivery no.
ABC-11245678400000000
ABC-11245678500000000
ABC-11245678600000000
BBC-12112233200000000
BBC-12112233400000000

 

My desired output is in this table format.

Order No.MaterialDelivery no.Delivery no.Delivery no.
ABC-11245678400000000500000000600000000
BBC-12112233200000000400000000 

 

Kindly please help to advise how to solve this in Power Query or Power BI.

 

2 REPLIES 2
spinfuzer
Solution Sage
Solution Sage

The easiest way to do it (but not necessarily the fastest or dynamic) is to

1) Group By Order No. and Material  With Operation All Rows and name is "All"

2) Add custom column named with formula:  Table.Transpose(Table.SelectColumns([All], "Delivery no."))

3) Expand and rename your columns

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRy1jU0VNJRMjIxNTO3ADJMDKBAKVYHm7wpAXkzFHknkLwRUNjQ0MjI2BikkIA8kv2xAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Order No." = _t, Material = _t, #"Delivery no." = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Order No.", type text}, {"Material", Int64.Type}, {"Delivery no.", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Order No.", "Material"}, {{"All", each _, type table [#"Order No."=nullable text, Material=nullable number, #"Delivery no."=nullable number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Transpose(Table.SelectColumns([All], "Delivery no."))),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"All"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2", "Column3"}, {"Column1", "Column2", "Column3"})
in
    #"Expanded Custom"

 

wdx223_Daniel
Super User
Super User

NewStep=Table.Combine(Table.Group(YourTable,{"Order No.","Material"},{"n",each #table({"Order No.","Material"}&List.Transform({1..Table.RowCount(_)},each "Deliver no. "&Text.From(_)),{{[#"Order No."]{0},[Material]{0}}&[#"Deliver no."]})})[n])

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors