let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Pack Config", "Location", "Location Zone", "Sub Zone", "Hazmat ID", "Batch ID"}, {{"ListID", each List.Min([List ID]), type number}, {"All", each _, type table [List ID=number, Pack Config=text, Location=text, Location Zone=text, Sub Zone=text, Hazmat ID=none, Batch ID=none, Count Date=datetime, Count Time=text, Expected=number, Counted=number, Variance=number]}}),
ListIDAsFirstCol = Table.ReorderColumns(#"Grouped Rows",{"ListID", "Pack Config", "Location", "Location Zone", "Sub Zone", "Hazmat ID", "Batch ID", "All"}),
GetFirst = Table.AddColumn(ListIDAsFirstCol, "First", each [All] {0}),
GetSecond = Table.AddColumn(GetFirst, "Second", each [All]{1}),
GetThird = Table.AddColumn(GetSecond, "Third", each [All]{2}),
#"Expanded First" = Table.ExpandRecordColumn(GetThird, "First", {"Count Date", "Count Time", "Expected", "Counted", "Variance"}, {"Count Date.1", "Count Time", "Expected", "Counted", "Variance"}),
#"Expanded Second" = Table.ExpandRecordColumn(#"Expanded First", "Second", {"Count Date", "Count Time", "Expected", "Counted", "Variance"}, {"Count Date.2", "Count Time.1", "Expected.1", "Counted.1", "Variance.1"}),
#"Expanded Third" = Table.ExpandRecordColumn(#"Expanded Second", "Third", {"Count Date", "Count Time", "Expected", "Counted", "Variance"}, {"Count Date", "Count Time.2", "Expected.2", "Counted.2", "Variance.2"})
in
#"Expanded Third"