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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
lardo5150
Microsoft Employee
Microsoft Employee

Convertir Excel Serial Date a normal m/d/aaaa hh:mm

He creado un flujo que toma un excel, hace algunas cosas y luego lo importa a SharePoint.

A continuación, agarro la lista de SharePoint.

El problema es que la fecha todavía está en el formato de Excel:

Ejemplos:

43766.6083449074
43753.594837963

43747.4251041667

Intenté cambiar la columna de ABC/123 a Date, y también intenté Date Time.

Recibo un error.

Asumo que tengo que crear una nueva columna y convertir la mía.

No estoy encontrando una respuesta clara sobre cómo hacerlo. He visto algunas fórmulas diferentes, pero nada que parecía que fuera para mi situación.

1 ACCEPTED SOLUTION

Hola @lardo5150 ,

Puedes probar los siguientes pasos:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NcjBCcAwDAPAXfwuxqlkOZ4leP81AoXe884xoiRXbJAdRZvny4Rnc6Na+I/lfHMFl1Q2cwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type number}}),
    #"Split Column by Character Transition" = Table.SplitColumn(Table.TransformColumnTypes(#"Changed Type", {{"date", type text}}, "en-US"), "date", Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c)), {"date.1", "date.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Character Transition",{{"date.1", Int64.Type}, {"date.2", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Date.AddDays(#date(1900, 01, 01), [date.1])),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Time.From([date.2])),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Custom1",{{"Custom", type date}, {"Custom.1", type time}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type2", {{"Custom", type text}, {"Custom.1", type text}}, "en-US"),{"Custom", "Custom.1"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Changed Type3" = Table.TransformColumnTypes(#"Merged Columns",{{"Merged", type datetime}})
in
    #"Changed Type3"

test_convert.PNG

Aquí está el ejemplo pbix.

Saludos
Liang
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

11 REPLIES 11
amitchandak
Super User
Super User

Debe añadir segundos o días en 1900/01/01

fecha: dateadd(date(1900,01,01),[Número de fecha],segundo)

O

fecha: dateadd(date(1900,01,01),[Número de fecha],Día)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Al lanzar un error, no le gusta dateadd.

[ClosedDateTime] es la columna en la que se encuentran esos seriales de Excel.

powerbi1.JPG

@lardo5150

Ese era Dax. M tiene Date.AddDays.

https://docs.microsoft.com/en-us/powerquery-m/date-adddays

Date.AddDays(#date(1900, 01, 01), [Días])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Estoy haciendo algo mal, pero no estoy seguro de qué.

powerbi2.JPGpowerbi3.JPGpowerbi4.JPG

Esta función solo toma Int

Date.AddDays(#date(1900,01,01),Number.Round([Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

todavía acaba de recibir un error

PowerBi1.JPG

chocando mientras busco una solución en este caso, ya que es la última pieza del proyecto en el que he estado trabajando.

ok, así que SPLIT la columna ClosedDateTime mediante el deliminator de (.)

Eso creó ClosedDateTime.1 y ClosedDateTime.2

Usé esto para ClosedDateTime.1

Date.AddDays(#date(1900, 01, 01), [ClosedDateTime.1])

Esto me dio la fecha, lo cual es genial.

Pero no puedo conseguir la hora en ClosedDateTime.2. ¿Sabes cuál es la expresión correcta?

powerbi2.JPG

Hola @lardo5150 ,

Puedes probar los siguientes pasos:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NcjBCcAwDAPAXfwuxqlkOZ4leP81AoXe884xoiRXbJAdRZvny4Rnc6Na+I/lfHMFl1Q2cwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type number}}),
    #"Split Column by Character Transition" = Table.SplitColumn(Table.TransformColumnTypes(#"Changed Type", {{"date", type text}}, "en-US"), "date", Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c)), {"date.1", "date.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Character Transition",{{"date.1", Int64.Type}, {"date.2", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Date.AddDays(#date(1900, 01, 01), [date.1])),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Time.From([date.2])),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Custom1",{{"Custom", type date}, {"Custom.1", type time}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type2", {{"Custom", type text}, {"Custom.1", type text}}, "en-US"),{"Custom", "Custom.1"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Changed Type3" = Table.TransformColumnTypes(#"Merged Columns",{{"Merged", type datetime}})
in
    #"Changed Type3"

test_convert.PNG

Aquí está el ejemplo pbix.

Saludos
Liang
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

EXACTAMENTE lo que estaba buscando y pude seguir lo que estabas haciendo.

Proporcionar la muestra fue una gran ayuda.

Gracias

oops, captura de pantalla equivocada

powerbi1.JPG

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.