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
Anonymous
Not applicable

Transformación de texto a fecha y hora

Hola

Actualmente tengo una columna con el siguiente valor:

2019-08-20T09:09:22.000-0500

y necesito transformarlo en un formato de fecha y hora para parecerme a este insead:

08/20/2019 9:09:22 PM

¿Es posible?

Gracias de antemano!

1 ACCEPTED SOLUTION

@delale01 asegúrese de que al convertir el tipo de datos de fecha/hora/zona a fecha/hora agregue esto como un nuevo paso en la consulta.

Me gustaría elogios si mi solución ayudara. 👉 Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hola @delale01 ,

Según mi opinión, desea cambiar el tipo de fecha de Texto a DateTime , y agregar el AM/PM al valor, ¿verdad? Además, como usted dio, el resultado debe ser AM, no PM.

Puede aplicar estos pasos en el Editor de consultas.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zcq7DcAgEETBXoi91ruVP0AdlyH6b8NklmxpwhmjmGiiyiStL/YOiBPK3N4QV1I7LN9gFMh3xvEL8wE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [dd = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"dd", type datetimezone}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "format datetime", each DateTimeZone.RemoveZone([dd])),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"format datetime", type datetime}}),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type1", {{"format datetime", type datetime}}, "en-US"),
    #"Changed Type with Locale1" = Table.TransformColumnTypes(#"Changed Type with Locale", {{"dd", type datetimezone}}, "en-US")
in
    #"Changed Type with Locale1"

1.PNG

Mi visualización de ejemplo tiene este aspecto:

3.PNG

¿Es el resultado lo que quieres? Si tiene alguna pregunta, cargue algunas muestras de datos y la salida esperada.

Por favor, enmascarar los datos confidenciales antes de cargar.

Saludos

Eyelyn Qin

parry2k
Super User
Super User

@delale01 en la consulta de energía (transformar datos), cambie el tipo de fecha a fecha/hora en lugar de fecha/zona horaria.

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@delale01 asegúrese de que al convertir el tipo de datos de fecha/hora/zona a fecha/hora agregue esto como un nuevo paso en la consulta.

Me gustaría elogios si mi solución ayudara. 👉 Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.