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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Formato de hora cambiando a datetime

Hola

Al exportar estos datos a Power Bi, 119:34:00 se muestra como 1/4/1900 11:34:00 PM. Probé todos los diferentes formatos de opitons en Power Bi, pero ninguno de ellos da como resultado 119:34:00, que es el número que necesito. ¡Por favor ayuda!

MLax_0-1677853432846.png

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@MLax

Puede guardar el archivo de Excel como tipo csv y luego importarlo a power bi, luego el tipo "Horas regulares" se convertirá en "Texto" en power bi, luego debe transferir los datos en power query, porque en power bi, no admite la hora durante 24 horas, debe transferir el tiempo a segundos

Puede colocar el siguiente código en Advanced Editor en power query para hacer referencia.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0tLQyNrEyMFCK1YlWMgKJmJlYGRvARIzBIhZWBsYwEROQiIk5TE0sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Employee = _t, #"Regular Hours" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Employee", Int64.Type}, {"Regular Hours", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Hours", each Text.Start([Regular Hours],3)),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Minutes", each Text.Middle([Regular Hours],4,2)),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Seconds", each Int64.From(Text.End([Regular Hours],2))+Int64.From([Hours])*3600+Int64.From([Minutes])*60),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom2",{"Hours", "Minutes"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Seconds", Int64.Type}})
in
    #"Changed Type1"

Salida

vxinruzhumsft_1-1678084729068.png

Y puede consultar el siguiente enlace.

excel - Sumar campos de tiempo durante 24 horas en Power Query - Desbordamiento de pila

¡Saludos!

Yolo Zhu

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors