Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Buenas tardes comunidad.
Espero me puedan ayudar con un problema en PowerQuery que no se si tiene solución.
Tengo una tabla con los registros Material - Clase de Movimiento y F.Contabilización
Como el unico dato que se repite es Material, quiero ordenar mi tabla de la siguiente forma:
de manera que en una fila quede el material y que se genere una nueva columna con las restantes 2 columnas.
Es decir, Clase de Mov, Fecha Contabilización, Clase de Mov2 y Fecha Contabilización.
He tratado de resolverlo con Pivot Columns y Unpivot Columns, pero no logro resolverlo.
Es posible realizar esto?
Gracias
Slds
Juan
Solved! Go to Solution.
Hi @JuanVR10
Please try the following code:
let
Source = Table.FromRecords({
[Material = 40330098410, Clase de movimiento = 101, Fecha Contabilizacion = #date(2024, 9, 5)],
[Material = 40330098410, Clase de movimiento = 601, Fecha Contabilizacion = #date(2024, 2, 1)]
}),
RemoveID = Table.RemoveColumns(Source, {"Material"}),
#"Grouped Rows" = Table.Group(Source, "Material", {
{"All Data", each Table.Pivot(
Table.RemoveColumns(_, {"Material"}),
List.Distinct(Table.TransformColumnTypes(_, {{"Fecha Contabilizacion", type text}}, "en-US")[Fecha Contabilizacion]),
"Fecha Contabilizacion", "Clase de movimiento"
)}
}),
#"Expanded Columns" = Table.ExpandTableColumn(#"Grouped Rows", "All Data", Table.ColumnNames(#"Grouped Rows"[All Data]{0}))
in
#"Expanded Columns"
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JuanVR10
Please try the following code:
let
Source = Table.FromRecords({
[Material = 40330098410, Clase de movimiento = 101, Fecha Contabilizacion = #date(2024, 9, 5)],
[Material = 40330098410, Clase de movimiento = 601, Fecha Contabilizacion = #date(2024, 2, 1)]
}),
RemoveID = Table.RemoveColumns(Source, {"Material"}),
#"Grouped Rows" = Table.Group(Source, "Material", {
{"All Data", each Table.Pivot(
Table.RemoveColumns(_, {"Material"}),
List.Distinct(Table.TransformColumnTypes(_, {{"Fecha Contabilizacion", type text}}, "en-US")[Fecha Contabilizacion]),
"Fecha Contabilizacion", "Clase de movimiento"
)}
}),
#"Expanded Columns" = Table.ExpandTableColumn(#"Grouped Rows", "All Data", Table.ColumnNames(#"Grouped Rows"[All Data]{0}))
in
#"Expanded Columns"
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.