Forum Discussion

skopcak's avatar
skopcak
Helper I
9 years ago
Solved

Query editor - Sum of Distinct Count by column

Hello, I have tables see the attachment, can I create a new column in the table that will contain the sum of the column number?     Text number RESULT: sum of column number Text1 4,2 7,...
  • MarcelBeug's avatar
    MarcelBeug
    9 years ago

    Strange that you already have the column in your input table.

     

    In the code below I just add a column with a slightly different name.

     

    let
        Zdroj = Excel.CurrentWorkbook(){[Name="Tabulka1"]}[Content],
        #"Změněný typ" = Table.TransformColumnTypes(Zdroj,{{"Text", type text}, {"number", type number}, {"RESULT: sum of column number", type number}}),
        #"Added Custom" = Table.AddColumn(#"Změněný typ", "Sum of column number", each List.Sum(#"Změněný typ"[number]))
    in
        #"Added Custom"