Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Buenas!!
No tengo mucho tiempo de Power Bi y me falta para comprender el Lenguaje M de Query (o codigo Dax), por lo que, necesito ayuda con lo siguiente..
Tengo la siguiente lista de telefonos con la prioridad de uso,segun otra caracteristica, y su codigo, referido a un cliente.
Lo que busco es una tabla como la siguiente, en power bi, que permita agrupar los codigos de clientes y todos sus telefonos asociados queden en las sucesivas columnas
Solved! Go to Solution.
¿Necesitas ordenar los telefonos en orden? Péguelo en el Editor avanzado, puede eliminar los alelos si no necesita nada.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bc+xDQAhDAPAXVJTBJKQzyyI/dd4QIqel1y4ObmwxyBVMTOnQnUl2GiW1AdqIO0MdYturbe27P5UoCpUS11rPu1QHWp+k2iXBlJnqEdS5ws=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [telefonos = _t, prioridad = _t, codigo = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"telefonos", type text}, {"prioridad", Int64.Type}, {"codigo", Int64.Type}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"prioridad", Order.Ascending}}),
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"codigo"}, {{"allrows", each _, type table [telefonos=nullable text, prioridad=nullable number, codigo=nullable number]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "telefonos", each Text.Combine( [allrows][telefonos],";")),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "telefonos", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"telefonos.1", "telefonos.2", "telefonos.3", "telefonos.4"})
in
#"Split Column by Delimiter"
¿Necesitas ordenar los telefonos en orden? Péguelo en el Editor avanzado, puede eliminar los alelos si no necesita nada.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bc+xDQAhDAPAXVJTBJKQzyyI/dd4QIqel1y4ObmwxyBVMTOnQnUl2GiW1AdqIO0MdYturbe27P5UoCpUS11rPu1QHWp+k2iXBlJnqEdS5ws=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [telefonos = _t, prioridad = _t, codigo = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"telefonos", type text}, {"prioridad", Int64.Type}, {"codigo", Int64.Type}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"prioridad", Order.Ascending}}),
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"codigo"}, {{"allrows", each _, type table [telefonos=nullable text, prioridad=nullable number, codigo=nullable number]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "telefonos", each Text.Combine( [allrows][telefonos],";")),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "telefonos", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"telefonos.1", "telefonos.2", "telefonos.3", "telefonos.4"})
in
#"Split Column by Delimiter"
Thanks!! yout contribution was a great help to me!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |