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! Principiante aquí.
Tengo problemas tratando de cambiar algunos datos.
Aquí hay un extracto de los datos que necesita cambiar.
Y lo necesito para que se vea así para que pueda hacer referencia a la hora y la fecha a otra tabla
Fecha | Hora | Req |
4/1/2020 | 12:00:00 AM | 56 |
4/1/2020 | 12:30:00 AM | 41 |
4/1/2020 | 1:00:00 AM | 31 |
4/2/2020 | 12:00:00 AM | 77 |
4/2/2020 | 12:30:00 AM | 58 |
4/2/2020 | 1:00:00 AM | 43 |
4/3/2020 | 12:00:00 AM | 83 |
4/3/2020 | 12:30:00 AM | 61 |
4/3/2020 | 1:00:00 AM | 49 |
4/3/2020 | 12:00:00 AM | 111 |
4/3/2020 | 12:30:00 AM | 93 |
4/3/2020 | 1:00:00 AM | 68 |
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
consulte la opción Transponer datos o unpivot
https://yodalearning.com/tutorials/power-query-helps-transposing-data/
https://radacad.com/pivot-and-unpivot-with-power-bi
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Gracias que funcionó! 😄
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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |