cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
revansh
Helper IV
Helper IV

TABLA DE FECHAS Y HORAS

Hola a todos

¿Podría proporcionar algunas entradas sobre la forma fácil de rellenar filas por hora entre 2 fechas.

Estoy buscando una tabla con 1 columna como abajo.

3/27 01.00

3/27 02.00

3/27 03.00

........

3/27 24.00

3/28 01.00

3/28 02.00

Gracias

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hola @revansh ,

¿Qué tal el resultado después de seguir las sugerencias mencionadas en mi publicación original? ¿Podría proporcionar más detalles al respecto si no cumple con su requisito?


Saludos

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hola @revansh ,

Podemos agregar una columna personalizada en Power Query Editor y luego expandirla nuevas filas para satisfacer sus requisitos:

List.DateTimes(
    [Start Date],
    Duration.TotalHours([End Date]-[Start Date]),
    #duration(0,1,0,0)
)

1.jpg2.jpg3.jpg

Todas las consultas están aquí:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyMDLQNdY1MlcwMLQyMAAiJEELBQMjuKChgVKsTrSSEaomY3RNxgbIJhmaKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, #"Start Date" = _t, #"End Date" = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Start Date", type datetime}, {"End Date", type datetime}, {"Value", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "DateTime", each List.DateTimes(
    [Start Date],
    Duration.TotalHours([End Date]-[Start Date]),
    #duration(0,1,0,0)
)),
    #"Expanded DateTime" = Table.ExpandListColumn(#"Added Custom", "DateTime")
in
    #"Expanded DateTime"


Si no cumple con su requisito, ¿podría mostrar el resultado exacto esperado basado en las Tablas que hemos compartido?


Saludos

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@revansh

Fecha y hora/hora separadas. Crear una tabla de fechas y una hora o una tabla de horas

Fecha: [Fecha y hora]. Fecha

Hora :Hora: [Hora de la fecha]. Hora //O formato([Fecha],"HH:MM:"SS") o formato([Fecha],"HH")

https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...

Para obtener lo mejor de la función de inteligencia de tiempo. Asegúrese de que tiene un calendario de fechas y se ha marcado como la fecha en la vista de modelo. Además, únase a él con la columna de fecha de su hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Dev Camp Session 30

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.