(InTbl as table) as table =>
let
NumCols = Table.ToList(Table.SelectColumns(Table.SelectRows(Table.Schema(InTbl), each ([Kind] = "number")),{"Name"})),
OtherCols = Table.ToList(Table.SelectColumns(Table.SelectRows(Table.Schema(InTbl), each ([Kind] <> "number")),{"Name"})),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(InTbl, OtherCols, "Attribute", "Value"),
#"Grouped Rows" = Table.Group(#"Unpivoted Columns", List.Combine({{"Attribute"}, OtherCols}), {{"Amount", each List.Sum([Value]), type number}}),
#"Pivoted Column" = if List.Count(NumCols) = 0 or List.Count(OtherCols) = 0 then Table.FromList({[Error Message="Columns Types were not set correctly"]}, Record.FieldValues, {"Error Message"}) else Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[Attribute]), "Attribute", "Amount", List.Sum)
in
#"Pivoted Column"