Hi,
I'm hoping someone can help me get addresses spread over a few rows into one row. The first table below is my input table and the second table is what I'd like to have as the output.
Any thoughts?
Solved! Go to Solution.
Thanks everyone. I figured it out myself.
let Source = vendors, Partition = Table.Group(Source, {"Account No"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}), #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Supplier Address", "Index"}, {"Partition.Supplier Address", "Partition.Index"}), #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU")[Partition.Index]), "Partition.Index", "Partition.Supplier Address") in #"Pivoted Column"
Cheers
not sure but try this, select first column, right click and choose "pivot others"
Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks everyone. I figured it out myself.
let Source = vendors, Partition = Table.Group(Source, {"Account No"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}), #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Supplier Address", "Index"}, {"Partition.Supplier Address", "Partition.Index"}), #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU")[Partition.Index]), "Partition.Index", "Partition.Supplier Address") in #"Pivoted Column"
Cheers
very nice
Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi I tried this on my data which is similar but it puts all of the address information against the first row and creates over 8,000 columns. Any tips on what might be wrong. I copied your code
The second step should be a Fill Down.... revised code:
let Source = vendors,
FillDown = Table.FillDown(Source, {"Account No"}), Partition = Table.Group(FillDown, {"Account No"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}), #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Supplier Address", "Index"}, {"Partition.Supplier Address", "Partition.Index"}), #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Expanded Partition", {{"Partition.Index", type text}}, "en-AU")[Partition.Index]), "Partition.Index", "Partition.Supplier Address") in #"Pivoted Column"
That's great it works fine now
User | Count |
---|---|
125 | |
81 | |
55 | |
55 | |
46 |