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
Estoy intentando crear una columna calculada usando la función PATH: Path = PATH(COMPONENTS, PARENT). Recibo el error "Cada valor en [COMPONENTS] debe tener el mismo valor en [PARENT]. El valor '001:1200035:RS3016-007' tiene varios valores".
¿Algún consejo sobre cómo resolver este problema?
ID DEL SITIO | FIN DEL ARTÍCULO | PADRE | COMPONENTES | RUTA DE SALIDA DESEADA |
001 | 1200035 | 1200035 | 1200035 | |
001 | 1200035 | 1200035 | 12035MARCO05 | 1200035/12035MARCO05 |
001 | 1200035 | 12035MARCO05 | 831203505 | 1200035/12035FRAME05/831203505 |
001 | 1200035 | 831203505 | 12035R-5 | 1200035/12035FRAME05/831203505/12035R-5 |
001 | 1200035 | 831203505 | 12035R1-2 | 1200035/12035FRAME05/831203505/12035R1-2 |
001 | 1200035 | 12035R1-2 | RS3016-007 | 1200035/12035FRAME05/831203505/12035R1-2/RS3016-007 |
001 | 1200035 | 12035R-5 | RS3016-007 | 1200035/12035FRAME05/831203505/12035R-5/RS3016-007 |
@kk1791 , Los dos últimos registros tienen el mismo componente pero un padre diferente, que puede el problema
Gracias por la respuesta. Mi pregunta es cuando hay varios padres para los componentes, ¿cómo crear una ruta? ¿Alguna otra opción para superar esto?
Parece que no hay una buena solución para manejarlo. El método posible es "eliminar" el valor duplicado del campo [COMPONENTS] para evitar este error... Creé un archivo pbix de muestra (ver archivo adjunto) para usted, verifique si eso es lo que desea. Puede seguir los pasos a continuación para obtenerlo:
1. Agregar nueva columna personalizada en el Editor de Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwVNJRMjQyMDAwNsXKitUhoMrY1C3I0dfVAKdShAIdJQtjsAAOxQhZqMYgXWIVGuoa4bYfLKujFBRsbGBopmtgYI5Hqa4pmspYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SITE ID" = _t, #"END ITEM" = _t, PARENT = _t, COMPONENTS = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"SITE ID", type text}, {"END ITEM", type text}, {"PARENT", type text}, {"COMPONENTS", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"COMPONENTS"}, {{"Count", each Table.RowCount(_), Int64.Type},{"Index", each Table.AddIndexColumn(_, "Index",1,1), type table}})//{{"Count", each Table.RowCount(_), Int64.Type},{"Index", each Table.AddIndexColumn(_, "Index",1,1)}, {"Details", each _, type table [SITE ID=nullable text, END ITEM=nullable text, PARENT=nullable text, COMPONENTS=nullable text]}})
,
#"Expanded Index" = Table.ExpandTableColumn(#"Grouped Rows", "Index", {"SITE ID", "END ITEM", "PARENT", "Index"}, {"SITE ID", "END ITEM", "PARENT", "Index"}),
#"Added Custom" = Table.AddColumn(#"Expanded Index", "NewComponents", each if [Count]>1 then [COMPONENTS]&"_"&Text.From([Index]) else [COMPONENTS]),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count", "Index"})
in
#"Removed Columns"
2. Cree una columna calculada como la siguiente para obtener la ruta
Column = PATH('Site'[NewComponents],'Site'[PARENT])
Saludos
Probé su solución y funcionó perfectamente. Gracias por ello. Pero cuando intento ejecutar para todas las ubicaciones para el mismo elemento final, recibo este error: el valor '35SHRINK2' en 'BOM' [PARENT] también debe existir en 'BOM' [NewComponents]. Agregue los datos que faltan e inténtelo de nuevo.
¿Podría guiarme sobre qué debo hacer para solucionar este problema?
Adjunto el enlace de datos como referencia: https://docs.google.com/spreadsheets/d/1Gzziln2BShPoVpeZm-ohKkcj_ctkPUBO/edit?usp=sharing&ouid=11116...
Gracias de antemano
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 |