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.
Hola a todos,
Nuevo en BI, tan desnudo conmigo. Estoy trabajando en Power Query, pero realmente estoy teniendo problemas para desenredar datos y cómo se formatea.
Aquí está el ejemplo del estado actual:
Nombre comapny | Iniciativa 1 | Descripción de la Iniciativa 1 | Objetivo de la Iniciativa 1 | Alcance de la Iniciativa 1 | Desafíos para la Iniciativa 1 | Iniciativa 2 | Descripción de la Iniciativa 2 | Meta para la Iniciativa 2 | Alcance de la Iniciativa 2 | Retos para la Iniciativa 2 | Iniciativa 3 | mismas columnas que las dos últimas |
Empresa 1 | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx |
Empresa 2 | ||||||||||||
Empresa 3 | ||||||||||||
No sé cómo desenredarlo de ser columnas separadas a sólo filas como esta (supongo que algunos despreoyentes, pero he sido infructuoso hasta ahora). Quiero que se vea así:
Nombre comapny | Iniciativa | Descripción de la iniciativa | Objetivo de iniciativa | Margen de iniciativa | Retos para la iniciativa |
Empresa 1 | Iniciativa 1 | Xxx | Xxx | Xxx | Xxx |
Empresa 1 | Iniciativa 2 | ||||
Empresa 1 | Iniciativa 3 | ||||
Empresa 2 | Iniciativa 1 | ||||
Empresa 2 | Iniciativa 2 | ||||
Empresa 2 | Iniciativa 3 | ||||
Empresa 3 | Iniciativa 1 | ||||
Empresa 3 | Iniciativa 2 | ||||
Empresa 3 | Iniciativa 3 |
He intentado desaprestizar solo las columnas seleccionadas en cada columna de la columna "Iniciativa X", pero eso solo lo consigue a mitad de camino, ya que todavía estoy atascado con todas las columnas de valor que permanecen donde están con 3 filas repetidas con sólo la columna initiativa siendo diferente, por lo que se lee así:
Nombre comapny | Descripción de la Iniciativa 1 | Objetivo de la Iniciativa 1 | Alcance de la Iniciativa 1 | Desafíos para la Iniciativa 1 | Descripción de la Iniciativa 2 | Meta para la Iniciativa 2 | Alcance de la Iniciativa 2 | Retos para la Iniciativa 2 | Iniciativa |
Empresa 1 | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Intitivo 1 |
Empresa 1 | éste | Es | todo el | Mismo | datos uno | Fila | encima | & Abajo | Intitivo 2 |
Empresa 1 | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Iniciativa 3 |
Empresa 2 | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Intitivo 1 |
Empresa 2 | éste | Es | todo el | Mismo | datos uno | Fila | encima | & Abajo | Intitivo 2 |
Empresa 2 | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Xxx | Iniciativa 3 |
¿Hay alguna buena manera de hacer esto?
¡Gracias!
Solved! Go to Solution.
Hola
Este código M funciona
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Comapny Name", type text}, {"Initiative 1", type text}, {"Description for Initiative 1", type text}, {"Goal for Initiative 1", type text}, {"Scope for Initiative 1", type text}, {"Challenges for Initiative 1", type text}, {"Initiative 2", type text}, {"Description for Initiative 2", type text}, {"Goal for Initiative 2", type text}, {"Scope for Initiative 2", type text}, {"Challenges for Initiative 2", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Comapny Name"}, "Attribute", "Value"),
#"Split Column by Character Transition" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Attribute.2"}),
#"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Attribute.2"})
in
#"Removed Columns"
Espero que esto ayude.
Hola
Este código M funciona
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Comapny Name", type text}, {"Initiative 1", type text}, {"Description for Initiative 1", type text}, {"Goal for Initiative 1", type text}, {"Scope for Initiative 1", type text}, {"Challenges for Initiative 1", type text}, {"Initiative 2", type text}, {"Description for Initiative 2", type text}, {"Goal for Initiative 2", type text}, {"Scope for Initiative 2", type text}, {"Challenges for Initiative 2", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Comapny Name"}, "Attribute", "Value"),
#"Split Column by Character Transition" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Attribute.2"}),
#"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Attribute.2"})
in
#"Removed Columns"
Espero que esto ayude.
¡Esto funcionó exactamente como yo estaba buscando! ¡Gracias :)!
De nada.
Hola, @Linksys45
De acuerdo con su descripción, hice algunos datos falsos y columnas unpivot en PQ.
Así:
Si no resuelve su problema, no dude en preguntarme.
Saludos
Janey Guo
Si este post ayuda, entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
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 |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |