let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [Column2] = null then [Index] else null),
#"Filled Up" = Table.FillUp(#"Added Custom",{"Custom"}),
#"Added Custom2" = Table.AddColumn(#"Filled Up", "Custom.1", each if [Column2] = null and [Index] = [Custom] then [Custom] +1 else [Custom]),
#"Grouped Rows" = Table.Combine(List.Transform(Table.Group(#"Added Custom2", {"Custom.1"}, {{"Count", each Table.Transpose(Table.SelectColumns(_, {"Column1", "Column2"}))
}})[Count], each Table.SelectRows(_, each [Column1] <> null)))
in
#"Grouped Rows"