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
Actualmente tengo algunos datos que aparecen así.
Nombre del ID Apellido Ubicación
3 John Smith Engalnd
3 John Smith España
En algunos casos, una persona puede tener 2 ubicaciones. y así es crear 2 filas para la misma persona. Lo ideal sería transformar los datos para que agregue un nuevo colum y elimine la otra fila.
Nombre del ID Apellido Ubicación1 Ubicación2
3 John Smith Inglaterra España
No sé si esto es una solución fácil, o es algo más avanzado, pero no puedo entenderlo.
Cualquier ayuda es apreciada
¡Gracias!
Hola
Este código M funciona
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
Partition = Table.Group(Source, {"ID"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
#"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"First Name", "Surname", "Location", "Index"}, {"First Name", "Surname", "Location", "Index"}),
#"Added Custom" = Table.AddColumn(#"Expanded Partition", "Custom", each "Location "&Number.ToText([Index])),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Custom]), "Custom", "Location")
in
#"Pivoted Column"
Espero que esto ayude.
en la powerquery, haga clic en agrupar por, configurar consulte la captura de pantalla siguiente.
actualizar la fórmula cambiando List.Sum([location]) a Text.Combine([location],",")
Proud to be a Super User!
@Howardd , Vea si pivotar puede ayudar
https://radacad.com/pivot-and-unpivot-with-power-bi
Transponer : https://yodalearning.com/tutorials/power-query-helps-transposing-data/
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 |