Forum Discussion
Anonymous
4 years agoNot applicable
Created Table Date/Hour
Hello to all. I am asking for your help in creating a time table. I would like to simulate a table going from 01/06/2021 at 00:00:00 to 01/07/2021 at 29:59:59 with each row incremented by one secon...
- 4 years ago
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let Source = List.DateTimes(#datetime(2021,1,6,0,0,0), Duration.TotalSeconds(#datetime(2021,1,7,23,59,59)-#datetime(2021,1,6,0,0,0))+1, #duration(0,0,0,1)), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type datetime}}) in #"Changed Type"Pat
mahoneypat
4 years agoMicrosoft Employee
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = List.DateTimes(#datetime(2021,1,6,0,0,0), Duration.TotalSeconds(#datetime(2021,1,7,23,59,59)-#datetime(2021,1,6,0,0,0))+1, #duration(0,0,0,1)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type datetime}})
in
#"Changed Type"
Pat
Anonymous
4 years agoNot applicable