Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hola
Necesito crear una tabla de fechas con todas las horas que tiene un día y que aparecen cada hora, es decir, de 00.00 a 23:00:00, una cita con cada hora.
La tabla debe comenzar a partir de 2016.
Salud
Xavi
Solved! Go to Solution.
Hola @XaviOV ,
Reemplazar 2020 por año (hoy())
Table 2 =
ADDCOLUMNS (
CROSSJOIN (
CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( YEAR(TODAY()), 12, 31 ) ),
'Table (2)'
),
"DateTime", [Date]+[Time]
)
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.
Hola @XaviOV ,
También puede intentar introducir una tabla de tiempo de 0:00:00 a 23:00:00 y, a continuación, utilizar la función Crossjoin.
Table 2 =
ADDCOLUMNS (
CROSSJOIN (
CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2020, 12, 31 ) ),
'Table (2)'
),
"DateTime", [Date]+[Time]
)
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.
Hola @V-lianl-msft Gracias por la solución, tengo una pregunta,
Veo que en la fórmula el final de la fórmula es hasta finales de este año, pero en el próximo año esta fórmula sólo aparecerá hasta el año 2020?
¿Cuál es la forma de no tener que cambiar la fórmula cada año?
saludos
Xavi
Hola @XaviOV ,
Reemplazar 2020 por año (hoy())
Table 2 =
ADDCOLUMNS (
CROSSJOIN (
CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( YEAR(TODAY()), 12, 31 ) ),
'Table (2)'
),
"DateTime", [Date]+[Time]
)
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.
Tabla: GENERATESERIES(DATE(2016,1,1),DATE(2020,12,31),.04166666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
@XaviOV también puede usar Power Query , pegar el código siguiente. Hay fecha de inicio y finalización que puede cambiar según sus necesidades.
let
StartDate = #datetime(2020, 4, 1, 0, 0, 0),
EndDate = #datetime(2020, 4, 30, 0, 0, 0),
//Get the number of dates that will be required for the table
GetDateCount = Duration.Days(EndDate - StartDate) + 1,
//Take the count of dates and turn it into a list of dates
GetDateList = List.DateTimes(StartDate, GetDateCount, #duration(1,1,0,0)),
#"Converted to Table" = Table.FromList(GetDateList, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "DateTime"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"DateTime", type datetime}})
in
#"Changed Type"
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.
Sería sugniffantly menos sobrecarga para construir una tabla de fechas con la función calendario, y una tabla de tiempo separada de 24 horas en un día. ¿Puedes entrar en más detalles de la meta final, tal vez podamos ayudar a llegar a un mejor enfoque?
Forrest
Proud to give back to the community!
Thank You!