Forum Discussion
PROBLEMS WITH DATES AND DATE TABLES
- 6 years ago
Hi EduardoPach,
I am not sure whether you want to create a calendar table which duration is one hour or you want to change datetime to date?
If you want to create datetime calendar table, you could try below M code
let Source = List.DateTimes(#datetime(2019, 01, 01, 00, 00, 0), 1000, #duration(0, 1, 0, 0)), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error) in #"Converted to Table"You could refer to List.DateTimes for details.
If you want to change datetime to date, you could right click column to change type->date in Edit Queries for both calendar and fact table.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi EduardoPach,
I am not sure whether you want to create a calendar table which duration is one hour or you want to change datetime to date?
If you want to create datetime calendar table, you could try below M code
let
Source = List.DateTimes(#datetime(2019, 01, 01, 00, 00, 0), 1000, #duration(0, 1, 0, 0)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
You could refer to List.DateTimes for details.
If you want to change datetime to date, you could right click column to change type->date in Edit Queries for both calendar and fact table.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.