let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID"}, "Attribute", "Value"),
#"Duplicated Column" = Table.DuplicateColumn(#"Unpivoted Other Columns", "Attribute", "Attribute - Copy"),
#"Removed Columns" = Table.RemoveColumns(#"Duplicated Column",{"ID"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Value]), "Value", "Attribute - Copy", List.Count),
#"Reordered Columns" = Table.ReorderColumns(#"Pivoted Column",{"Attribute", "sm", "med", "lg"})
in
#"Reordered Columns"