let
Source = Excel.CurrentWorkbook(){[Name="TableMain"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Bus Driver Name", type text}, {"Kindergarten", type text}, {"Timing", type number}, {"Boys School", type text}, {"Timing2", type number}, {"Girls School Cycle1", type text}, {"Timing3", type number}, {"Girls School Cycle2", type text}, {"Timing4", type number}, {"Girls School Cycle3", type text}, {"Timing5", type number}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Bus Driver Name"}, "Atrybut", "Wartość"),
#"Added Index" = Table.AddIndexColumn(#"Unpivoted Other Columns", "Indeks", 0, 1),
#"Inserted Modulo" = Table.AddColumn(#"Added Index", "Wstawiono modulo", each Number.Mod([Indeks], 2), type number),
#"Changed Type1" = Table.TransformColumnTypes(#"Inserted Modulo",{{"Wstawiono modulo", type text}}),
#"Integer-Divided Column" = Table.TransformColumns(#"Changed Type1", {{"Indeks", each Number.IntegerDivide(_, 2), Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Integer-Divided Column",{"Atrybut"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"Wstawiono modulo"]), "Wstawiono modulo", "Wartość"),
#"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Indeks"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns1",{{"1", type time}}),
#"Sorted Rows" = Table.Sort(#"Changed Type2",{{"1", Order.Ascending}}),
#"Pivoted Column1" = Table.Pivot(Table.TransformColumnTypes(#"Sorted Rows", {{"1", type text}}, "pl-PL"), List.Distinct(Table.TransformColumnTypes(#"Sorted Rows", {{"1", type text}}, "pl-PL")[#"1"]), "1", "0")
in
#"Pivoted Column1"