Forum Discussion
JorgePereira
6 years agoHelper I
Summarize with text
Hello everyone, I have the table below Product Amount Store Tomato 10 A Carrot 5 A Onion 8 A Cucumber 12 A Tomato 8 B Carrot 2 B Carrot 15 C Onion 13 C ...
- 6 years ago
Have you tried using the CONCATENATEX DAX command? How about this? (Sorry, replace "," with "-")
Medida: CONCATENATEX (Vegs, Vegs [Store], ",")
camargos88
6 years agoCommunity Champion
Hi JorgePereira ,
Try this mcode:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsnPTSzJV9JRMjQAEo5KsTrRSs6JRUX5JUCuKVzIPy8zPw/Is0AoKk0uzU1KLQJpNYKLwo0DKXRCNc0IU8gQZIMzig2GxhChWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Amount = _t, Store = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Amount", Int64.Type}, {"Store", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Product"}, {
{"Amount", each List.Sum([Amount]), type nullable number},
{"Store", each Text.Combine([Store], "-"), type text}
}
)
in
#"Grouped Rows"