Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Estoy en un aprieto tratando de transponer mi mesa que aparece como abajo y apreciaría enormemente la ayuda. Me gustaría transponer statusname y statustime para que el producto final sea como se muestra debajo de la tabla principal. De esta manera, puedo calcular las diferencias de tiempo entre los nombres de estado.
CustomerId | DeliveryId | DocumentId | ShortId | StatusName | StatusTime |
2 | 25 | 5 | CPU6096178 | asignado | 12/3/2020 20:08 |
2 | 25 | 5 | CPU6096178 | a la espera dePickup | 12/3/2020 20:08 |
2 | 25 | 5 | CPU6096178 | íntegro | 12/3/2020 22:52 |
2 | 25 | 5 | CPU6096178 | entregado | 12/3/2020 22:52 |
2 | 25 | 5 | CPU6096178 | inProgress | 12/3/2020 20:08 |
2 | 25 | 5 | CPU6096178 | Elegido | 12/3/2020 22:52 |
2 | 25 | 5 | CPU6096178 | abastecimientoCourier | 12/3/2020 20:08 |
2 | 25 | 60 | CPU1265194 | asignado | 11/10/2020 19:25 |
2 | 25 | 60 | CPU1265194 | a la espera dePickup | 11/10/2020 19:25 |
2 | 25 | 60 | CPU1265194 | íntegro | 11/10/2020 23:36 |
2 | 25 | 60 | CPU1265194 | entregado | 11/10/2020 23:36 |
2 | 25 | 60 | CPU1265194 | inProgress | 11/10/2020 19:25 |
2 | 25 | 60 | CPU1265194 | inTransit | 11/10/2020 22:19 |
2 | 25 | 60 | CPU1265194 | Elegido | 11/10/2020 22:19 |
2 | 25 | 60 | CPU1265194 | recogida | 11/10/2020 22:19 |
2 | 25 | 60 | CPU1265194 | abastecimientoCourier | 11/10/2020 19:25 |
62 | 9 | 19 | CPU4702103 | asignado | 10/13/2020 22:27 |
62 | 9 | 19 | CPU4702103 | a la espera dePickup | 10/13/2020 22:27 |
62 | 9 | 19 | CPU4702103 | íntegro | 10/14/2020 0:29 |
62 | 9 | 19 | CPU4702103 | entregado | 10/14/2020 0:29 |
62 | 9 | 19 | CPU4702103 | entregado | 10/14/2020 0:32 |
62 | 9 | 19 | CPU4702103 | Enviado | 10/13/2020 22:40 |
62 | 9 | 19 | CPU4702103 | inProgress | 10/13/2020 22:27 |
62 | 9 | 19 | CPU4702103 | inTransit | 10/13/2020 23:31 |
62 | 9 | 19 | CPU4702103 | Elegido | 10/13/2020 23:31 |
62 | 9 | 19 | CPU4702103 | recogida | 10/13/2020 23:31 |
62 | 9 | 19 | CPU4702103 | abastecimientoCourier | 10/13/2020 22:27 |
Me gustaría que apareciera como a continuación
CustomerId | DeliveryId | DocumentId | ShortId | asignado | a la espera dePickup | íntegro | entregado | inProgress | inTransit | Elegido | abastecimientoCourier | Recogida |
2 | 25 | 5 | CPU6096178 | 12/3/2020 20:08 | 12/3/2020 20:08 | 12/3/2020 22:52 | 12/3/2020 22:52 | 12/3/2020 20:08 | nulo | 12/3/2020 22:52 | 12/3/2020 20:08 | nulo |
2 | 25 | 60 | CPU1265194 | 11/10/2020 19:25 | 11/10/2020 19:25 | 11/10/2020 23:36 | 11/10/2020 23:36 | 11/10/2020 19:25 | 11/10/2020 22:19 | 11/10/2020 22:19 | 11/10/2020 19:25 | 11/10/2020 22:19 |
Muchas gracias.
Solved! Go to Solution.
hola
Puede usar la transformación Tabla dinámica en la consulta de energía.
Seleccione el nombre de estado de la columna y la hora de estado.
Haga clic en Columna dinámica
Seleccione Propiedades de tabla dinámica de la siguiente manera
Obtendrá los siguientes resultados
saludos
Sayali
Si este post ayuda, entonces considere Aceptarlo como la solución para ayudar a otros a encontrarlo más rápidamente.
Muy simple, pero antes de su publicación me tomó horas (!) reemplazar esta función usando medidas.
Tenemos una opción en tabla de matrices, es muy fácil transponer los coloumns. no hay necesidad de opciones complejas de pivote. solo un botón de interruptor ayudaría a lograr estoHighlightedResaltado
Simplemente agrupale filas por CustomerId/DeliveryId/DocumentId/ShortId y pivote la tabla derivada; entonces se hace.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("rdO9boMwEAfwV6mYI3F3BhN7zQswlCnKgIiVWqWADGlfv0YMYEB1jDoARuh3/rg/12tE0Smi1N7G65IXHATH7Gxfyrpuq3JQdztGillMQPBGIOEc3U5/yp9SD7p55Lr6fHbBvGq/uloNyoUkU/LAu6r1tzLrFb8gdZOb9mFU3wevtrObPDBj3z5NZc/oYp9aGd+0HKYCSDxFkazbgzHCZFFIC3x206DAAssWzZSYZNxHnSYFWrdNgWvWzbspm14Pq4lJovDZucmHYNEdoDsJ2dsxH0uI8auYKiQZEAJbRwRinONJmdduIhJYYBkRS5OJgiThk05C/oky8lLdd+VQfeycVgI+7AYz8KScYC6s/SPQZ+dgHoLFurOv0J1gbnZ8+wU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CustomerId = _t, DeliveryId = _t, DocumentId = _t, ShortId = _t, StatusName = _t, StatusTime = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CustomerId", Int64.Type}, {"DeliveryId", Int64.Type}, {"DocumentId", Int64.Type}, {"ShortId", type text}, {"StatusName", type text}, {"StatusTime", type datetime}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"CustomerId", "DeliveryId", "DocumentId", "ShortId"}, {{"ar", each Table.Pivot(_, List.Distinct(#"Changed Type"[StatusName]), "StatusName", "StatusTime")}}),
#"Expanded ar" = Table.ExpandTableColumn(#"Grouped Rows", "ar", {"allocated", "awaitingPickup", "complete", "delivered", "inProgress", "picked", "sourcingCourier", "inTransit", "pickedUp", "dispatched"}, {"allocated", "awaitingPickup", "complete", "delivered", "inProgress", "picked", "sourcingCourier", "inTransit", "pickedUp", "dispatched"})
in
#"Expanded ar"
Pero hasta donde yo sé, la tabla unidimensional original funciona bien en el modelo de datos PBI en la mayoría de los casos; tales transformaciones a veces son redundantes.
Gracias @CNENFRNL por su tiempo. Esto resultó ser demasiado complejo para mí, todavía un novie en esto, y en su lugar fue con pivote descrito a continuación por @sayaliredij .
hola
Puede usar la transformación Tabla dinámica en la consulta de energía.
Seleccione el nombre de estado de la columna y la hora de estado.
Haga clic en Columna dinámica
Seleccione Propiedades de tabla dinámica de la siguiente manera
Obtendrá los siguientes resultados
saludos
Sayali
Si este post ayuda, entonces considere Aceptarlo como la solución para ayudar a otros a encontrarlo más rápidamente.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.