Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |