Forum Discussion
Query editor - Sum of Distinct Count by column
- 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"
You can simply add a custom column with the formula below, in which "<PreviousStep>" is the name of the previous step in your query:
= List.Sum(<PreviousStep>[number])
Otherwise it looks to me like a DAX measure would be more appropriate.
You should be able to suggest solutions in code?
CODE:
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}})
in
#"Změněný typ"
:CODE
thank you for answer
- MarcelBeug9 years agoCommunity Champion
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"- skopcak9 years agoHelper I
Thank you very much, that's exactly what I needed.