Transpose from columns to rows. Pivot/Unpivot seems to not apply in this situation

nangys

New member
Joined
Jan 4, 2017
Messages
11
Reaction score
0
Points
0
Excel Version(s)
2010
Hi,

I have tried to use pivot/unpivot functions and the tranpose function but they do not seem to work in this situation.

transpose.png

Thank you in advance.

Fernando
 

Attachments

  • TransposeExa.xlsx
    8 KB · Views: 13
I hope it helps.
 

Attachments

  • TransposeExa.xlsx
    18.5 KB · Views: 26
Last edited:
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Region"}, {{"All", each Table.AddIndexColumn(_,"Index",1,1), type table }}),
    #"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", {"Zip", "Index"}, {"Zip", "Index"}),
    #"Added Prefix" = Table.TransformColumns(#"Expanded All", {{"Index", each "ZIP" & Text.From(_), type text}}),
    #"Pivoted Column" = Table.Pivot(#"Added Prefix", List.Distinct(#"Added Prefix"[Index]), "Index", "Zip")
in
    #"Pivoted Column"
 
Much appreciated Thank you!
 
Back
Top