Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Vicktorlive
Frequent Visitor

Cambiar filas a columna

¡Hola! Principiante aquí.

Tengo problemas tratando de cambiar algunos datos.

Aquí hay un extracto de los datos que necesita cambiar.

Table1.PNG

Y lo necesito para que se vea así para que pueda hacer referencia a la hora y la fecha a otra tabla

FechaHoraReq
4/1/202012:00:00 AM56
4/1/202012:30:00 AM41
4/1/20201:00:00 AM31
4/2/202012:00:00 AM77
4/2/202012:30:00 AM58
4/2/20201:00:00 AM43
4/3/202012:00:00 AM83
4/3/202012:30:00 AM61
4/3/20201:00:00 AM49
4/3/202012:00:00 AM111
4/3/202012:30:00 AM93
4/3/20201:00:00 AM68

Ya traté de pivotar / despivotar, y traté de ejecutar un script python y no puedo hacer que funcione.

¿Es esto algo que puedo hacer en power query / power bi?

Cualquier ayuda es apreciada

3 REPLIES 3
amitchandak
Super User
Super User
mahoneypat
Employee
Employee

Sí. Esto se puede hacer fácilmente en Power BI en el editor de consultas. Puse una tabla similar y utilicé el código M a continuación para transformarlo en la salida deseada. Por favor, péguelo en una consulta en blanco (en el Editor avanzado) para ver una manera de acercarse a esta.

Dejar
Fuente: Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtE31DcyMDJQ0lEyBBFAVqwOSNgIJmwMIkyAwrEA", BinaryEncoding.Base64), Compression.Deflate)), let _t á ((texto de tipo) meta [Serialized.Text ? true]) en la tabla de tipos [Revisado a _t, á"12/31/1899 12:00:00 AM" - _t, "12/31/1899 12:30:00 AM _t"
"Otras columnas no pivotadas" á Tabla.UnpivotOtherColumns(Source, ?"Revised", "Attribute", "Value"),
"Texto extraído después del delimitador" - Tabla.TransformColumns("Unpivoted Other Columns", "Attribute", cada Text.AfterDelimiter(_, " " "), texto de texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto, texto
"Columnas combinadas" - Table.CombineColumns(?"Texto extraído después del delimitador", "Revisado", "Atributo",Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"DateTime"),
"Changed Type1" á Table.TransformColumnTypes("Columnas combinadas", "DateTime", tipo datetime)
En
"Tipo cambiado1"

Si esta solución funciona para usted, márquela como la solución. Los felicitaciones también son apreciados. Por favor, avísame si no.
saludos
palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Gracias que funcionó! 😄

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.