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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How To assemble data data in Power query

Hi All,

I need help in to assemble data in below manner

Problem

Column1Column6Column7Column8Column9
Sep 2020FunctionQueueQueueQueue
Sep 2020PriorityP1P1P1
Sep 2020TeamMemberInsurancePension
Sep 2020Team Target Coverage10.90.9
 Oct 2020FunctionQueue  
 Oct 2020PriorityP1P1P1
 Oct 2020TeamMemberInsurancePension
 Oct 2020Team Target Coverage10.90.9
 Nov 2020FunctionQueue  
 Nov 2020PriorityP1P1P1
 Nov 2020TeamQeue-MemberInsurancePension
 Nov 2020Team Target Coverage10.90.9

 

Solution

 

MonthFunctionPriorityTeamTeam Target Coverage
Sep-20QueueP1Member1
Sep-20QueueP1Insurance0.9
Sep-20QueueP1Pension0.9
Oct-20QueueP1Member1
Oct-20 P1Insurance0.9
Oct-20 P1Pension0.9
Nov-20QueueP1Qeue-Member1
Nov-20 P1Insurance0.9
Nov-20 P1Pension0.9
1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can use a Table.Group where you apply a Table.Transpose, Table.Ski and a Table.PromoteHeaders.

Here the code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jY6xCsIwEIZfJWSuErs5C4KD2mK30iGGo2RoItek0Lc3Jx1ilDZD7v7h+y9f2/IHvFgpSsELfvZGOW1NiLUHDz+7K774CrVF7WaKh2gkWANyCOsKwxMwhIsZPUqj6G4FZqQf/1RYI7EHx052ApQ90XRf7I/LpA67K7eizz4vBde8Yy5XPO3kmd/slGcegavmEbeY1+HWbls/KW7rd28=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"AllRows", each Table.PromoteHeaders(Table.Skip(Table.Transpose(_), 1))}}),
    #"Expanded AllRows" = Table.ExpandTableColumn(#"Grouped Rows", "AllRows", {"Function", "Priority", "Team", "Team Target Coverage"}, {"Function", "Priority", "Team", "Team Target Coverage"})
in
    #"Expanded AllRows"

Jimmy801_0-1606909780967.png

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

1 REPLY 1
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can use a Table.Group where you apply a Table.Transpose, Table.Ski and a Table.PromoteHeaders.

Here the code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jY6xCsIwEIZfJWSuErs5C4KD2mK30iGGo2RoItek0Lc3Jx1ilDZD7v7h+y9f2/IHvFgpSsELfvZGOW1NiLUHDz+7K774CrVF7WaKh2gkWANyCOsKwxMwhIsZPUqj6G4FZqQf/1RYI7EHx052ApQ90XRf7I/LpA67K7eizz4vBde8Yy5XPO3kmd/slGcegavmEbeY1+HWbls/KW7rd28=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"AllRows", each Table.PromoteHeaders(Table.Skip(Table.Transpose(_), 1))}}),
    #"Expanded AllRows" = Table.ExpandTableColumn(#"Grouped Rows", "AllRows", {"Function", "Priority", "Team", "Team Target Coverage"}, {"Function", "Priority", "Team", "Team Target Coverage"})
in
    #"Expanded AllRows"

Jimmy801_0-1606909780967.png

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors