Pivot Columns with repeating rows

swmakin

New Member
Joined
Apr 29, 2016
Messages
5
I am trying to pivot columns with repeating data to rows. However as I have duplicated information in the Data column when I Pivot (Don't aggregate) I get the following error message.

[TABLE="width: 195"]
<tbody>[TR]
[TD][TABLE="width: 256"]
<tbody>[TR]
[TD]Value[/TD]
[TD]Data[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Eric[/TD]
[/TR]
[TR]
[TD]Address Line 1[/TD]
[TD]29 Acacia Road[/TD]
[/TR]
[TR]
[TD]Address Line 2[/TD]
[TD]Dandytown[/TD]
[/TR]
[TR]
[TD]Address Line 3[/TD]
[TD]Beano[/TD]
[/TR]
[TR]
[TD]Address Line 4[/TD]
[TD]SE10 1BA[/TD]
[/TR]
[TR]
[TD]Address Line 5[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Address Line 6[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]General Blight[/TD]
[/TR]
[TR]
[TD]Address Line 1[/TD]
[TD]29 Acacia Road[/TD]
[/TR]
[TR]
[TD]Address Line 2[/TD]
[TD]Dandytown[/TD]
[/TR]
[TR]
[TD]Address Line 3[/TD]
[TD]Beano[/TD]
[/TR]
[TR]
[TD]Address Line 4[/TD]
[TD]SE10 1BA[/TD]
[/TR]
[TR]
[TD]Address Line 5[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Address Line 6[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Chief O'Reilly[/TD]
[/TR]
[TR]
[TD]Address Line 1[/TD]
[TD]29 Acacia Road[/TD]
[/TR]
[TR]
[TD]Address Line 2[/TD]
[TD]Dandytown[/TD]
[/TR]
[TR]
[TD]Address Line 3[/TD]
[TD]Beano[/TD]
[/TR]
[TR]
[TD]Address Line 4[/TD]
[TD]SE10 1BA[/TD]
[/TR]
[TR]
[TD]Address Line 5[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Address Line 6[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Expression.Error: There were too many elements in the enumeration to complete the operation.
Details:
List

Help much appreciated.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Code:
let
    Source = Table1,
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
    AddedCustom = Table.AddColumn(#"Added Index", "Address Line 1", each #"Added Index"{[Index]+1}[Data]),
    AddedCustom2 = Table.AddColumn(AddedCustom, "Address Line 2", each #"Added Index"{[Index]+2}[Data]),
    AddedCustom3 = Table.AddColumn(AddedCustom2, "Address Line 3", each #"Added Index"{[Index]+3}[Data]),
    AddedCustom4 = Table.AddColumn(AddedCustom3, "Address Line 4", each #"Added Index"{[Index]+4}[Data]),
    AddedCustom5 = Table.AddColumn(AddedCustom4, "Address Line 5", each #"Added Index"{[Index]+5}[Data]),
    AddedCustom6 = Table.AddColumn(AddedCustom5, "Address Line 6", each #"Added Index"{[Index]+6}[Data]),
    #"Renamed Columns" = Table.RenameColumns(AddedCustom6,{{"Data", "Name"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Index"}),
    #"Removed Alternate Rows" = Table.AlternateRows(#"Removed Columns",1,6,1)
in
    #"Removed Alternate Rows"
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top