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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Adrian_PBI
New Member

Modelado Datos Fecha / Horas

Hola estimados , soy nuevo en el uso del Power BI y tengo un problema que no puedo solucionar, me podrían ayudar a modelar una columna con FECHA / HORA y tiene Formato 24 horas y quisiera pasarlo a formato Fecha / HORA  00:00, ya 

 que el Power BI y Query no reconocen este formato. 

 

Dejo Ejemplo de las columnas de entrada y también los intentos con una función encontrada en Internet, y me arroja error 

 

gracias quien me pueda ayudar

 

 

Adrian_PBI_2-1731874834943.png

 

 

 

 

Adrian_PBI_0-1731874750974.png

 

1 ACCEPTED SOLUTION
Omid_Motamedise
Super User
Super User

You can use DateTime.ToText as below

 

= DateTime.ToText([YourTimeColumn], "h:mm tt")


If my answer helped solve your issue, please consider marking it as the accepted solution.

View solution in original post

2 REPLIES 2
Omid_Motamedise
Super User
Super User

You can use DateTime.ToText as below

 

= DateTime.ToText([YourTimeColumn], "h:mm tt")


If my answer helped solve your issue, please consider marking it as the accepted solution.
lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLWNzDSNzIwMlAwMrAyNFWK1UEVNLEyMFCKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Fecha/Hora(Hasta)" = _t]),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Fecha/Hora(Hasta)", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Fecha/Hora(Hasta).1", "Fecha/Hora(Hasta).2"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Fecha/Hora(Hasta).1", type date}, {"Fecha/Hora(Hasta).2", type duration}},"es-MX"),
    #"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"Fecha/Hora(Hasta).2", #duration(1, 0, 0, 0)}}),
    #"Added Custom" = Table.AddColumn(#"Replaced Errors", "Fecha/Hora(Hasta)", each DateTime.From([#"Fecha/Hora(Hasta).1"]) + [#"Fecha/Hora(Hasta).2"],type datetime),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Fecha/Hora(Hasta)"})
in
    #"Removed Other Columns"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors