Can you post some sample data and the results you want to see, based on that sample data?
DEPT | CLASS | VENDOR | INV | SALES | PURCH | RTV | UNITAD | PRCCHG | ALLOW |
1 | 136 | 1122 | 713 | 541 | 807 | 944 | 763 | 931 | 651 |
1 | 136 | 1122 | 695 | 971 | 508 | 660 | 579 | 907 | 848 |
1 | 136 | 1313 | 766 | 977 | 739 | 503 | 536 | 795 | 971 |
1 | 136 | 1313 | 856 | 558 | 758 | 684 | 507 | 981 | 702 |
2 | 210 | 2247 | 534 | 779 | 874 | 595 | 959 | 828 | 812 |
2 | 210 | 2247 | 948 | 722 | 685 | 762 | 681 | 623 | 586 |
2 | 210 | 2888 | 922 | 927 | 974 | 574 | 806 | 897 | 910 |
2 | 210 | 2888 | 764 | 618 | 612 | 661 | 825 | 780 | 633 |
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{
{"DEPT", Int64.Type},
{"CLASS", Int64.Type},
{"VENDOR", Int64.Type},
{"INV", Int64.Type},
{"SALES", Int64.Type},
{"PURCH", Int64.Type},
{"RTV", Int64.Type},
{"UNITAD", Int64.Type},
{"PRCCHG", Int64.Type},
{"ALLOW", Int64.Type}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type",
{"DEPT", "CLASS", "VENDOR"},
"Attribute",
"Value"),
#"Grouped Rows" = Table.Group(#"Unpivoted Other Columns",
{"DEPT", "CLASS", "VENDOR"},
{{"Totals", each List.Sum([Value]), type number}})
in
#"Grouped Rows"
DEPT CLASS VENDOR Totals
1 136 1122 10518
1 136 1313 10333
2 210 2247 10388
2 210 2888 10903