Forum Discussion
zaza
6 years agoResolver III
Table.Profile sum based on another column
I'm stuck with something that seems very simple but for some reason I can't seem to be able to make it work. I have the following table: I create a new query in order to do a table prof...
- 6 years ago
Hi zaza ,
please try this:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQ0lEyBGEDAwOlWJ1oCAdFALcSfPIGBpiGQMTQ1eBQYICwJRYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", Int64.Type}, {"Column3", Int64.Type}}), Custom1 = Table.Profile(#"Changed Type"), #"Added Custom" = Table.AddColumn(Custom1, "Custom", each List.Sum(Table.SelectRows(#"Changed Type", (inner) => Record.Field(inner, [Column]) = 1)[Column1])) in #"Added Custom"
PDJsh
3 years agoRegular Visitor
Hi,
I have another similar issue.
I have two columns,
column 1 is a month column(which also includes a row called annual),
column 2 are values
i want to calculate the sum of values from July to June excluding annual.
Could u please help?