Forum Discussion
JorgePereira
Helper I
6 years agoResumir con texto
Hola a todos,
Tengo la tabla de abajo
| Producto | Cantidad | Tienda |
| Tomate | 10 | A |
| Zanahoria | 5 | A |
| Cebolla | 8 | A |
| Pepino | 12 | A |
| Tomate | 8 | B |
| Zanahoria | 2 | B |
| Zanahoria | 15 | C |
| Cebolla | 13 | C |
y necesito la mesa final usando "Resumir"
¿Puedes ayudarme a unirme a las tiendas como en la siguiente tabla?
| Producto | Cantidad | Tienda |
| Tomate | 18 | A-B |
| Zanahoria | 22 | A-B-C |
| Cebolla | 21 | A-C |
| Pepino | 12 | A |
¿Ha intentado utilizar el comando CONCATENATEX DAX? ¿Qué tal esto? (Lo sentimos, reemplace "," por "-")
Medida: CONCATENATEX( Vegs, Vegs[Store], ",")
2 Replies
- camargos88
Community Champion
Hola @JorgePereira ,
Pruebe este 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" - fhill
Resident Rockstar
¿Ha intentado utilizar el comando CONCATENATEX DAX? ¿Qué tal esto? (Lo sentimos, reemplace "," por "-")
Medida: CONCATENATEX( Vegs, Vegs[Store], ",")