Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
¡Felices fiestas a todos! Necesita ayuda para transformar estos datos que provienen de la herramienta cliente de la siguiente manera:
Nombre | 1.1 | 1.1 Puntuación | 1.2 | 1.2 Puntuación | 2.1 | 2.2 Puntuación |
Nombre 1 | Asistencia | 100% | Calidad | 85% | Adherencia | 60% |
Nombre 2 | Asistencia | 50% | Productividad | 0% | SLA | 75% |
El resultado que estoy tratando de lograr sería:
Nombre | Atributo | Puntuación |
Nombre 1 | Asistencia | 100% |
Nombre 1 | Calidad | 85% |
Nombre 1 | Adherencia | 60% |
Nombre 2 | Asistencia | 50% |
Nombre 2 | Productividad | 0% |
Nombre 2 | SLA | 75% |
Intenté despivotar columnas / despivotar otras columnas una columna a la vez y también simultáneamente, pero no obtengo el resultado deseado. Para agregar contexto, debo crear un objeto visual para mostrar el recuento de instancias de puntuación del 0% por atributo/métrica.
Cualquier solución sería de gran ayuda 🙇
¡Gracias, señor! trabajo impresionante.. Tuve que mirar cada paso para entender lo que sucedió
Bastante creativo para usar el 1.1 etc para agrupar columnas. ¡Lo agradezco!
Estoy feliz de saber que podría ayudar. 🙂 Si algunos pasos no están claros para usted (por qué lo hice), solo pregunte.
P.S. No es importante, pero soy una chica 😁 No "señor".
Lo siento >< muchas gracias Sra. Bolfri y felices fiestas
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kvMTVUwVNJRciwpSc1LScxLTgVyDA0MdAwMVIGswNLEnMySSiDLwhQq5JiSkVqUClFoBlEXqwM1yQjdJFOYQQFF+SmlySWZZRDTYMLBPo5A0hxidmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"1.1" = _t, #"1.1 Score" = _t, #"1.2" = _t, #"1.2 Score" = _t, #"2.2" = _t, #"2.2 Score" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"1.1", type text}, {"1.1 Score", Percentage.Type}, {"1.2", type text}, {"1.2 Score", Percentage.Type}, {"2.2", type text}, {"2.2 Score", Percentage.Type}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Context", "Value"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Columns", "Type", each if Text.Contains([Context],"Score") then "Score" else "Attribute"),
#"Pivoted Column" = Table.Pivot(#"Added Custom", List.Distinct(#"Added Custom"[Type]), "Type", "Value"),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Pivoted Column", {{"Context", each Text.BeforeDelimiter(_, " "), type text}}),
#"Grouped Rows" = Table.Group(#"Extracted Text Before Delimiter", {"Name", "Context"}, {{"Attribute", each List.Max([Attribute]), type nullable text}, {"Score", each List.Max([Score]), type nullable number}})
in
#"Grouped Rows"
Antes:
Después: