Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Evening,
I've follow the guides to setup a Date Table using powerquery and it works perfectly.
let
Source = #date(2010, 1, 1),
Custom1 = List.Dates(Source, Number.From(DateTime.LocalNow())- Number.From(Source) ,#duration(1,0,0,0)),
#"Converted to Table" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),I was wondering how to change it from simply creating the DateTable "DateTime.LocalNow()" until today, but until say for example the 1/1/2018 instead.
Thoughts on the powerquery code?
Solved! Go to Solution.
Just replace DateTime.LocalNow() by #date(2018,1,1).
Alternative code:
let
Source = Table.FromColumns({{Number.From(#date(2017,1,1))..Number.From(#date(2018,1,1))}}),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}})
in
#"Changed Type"
Just replace DateTime.LocalNow() by #date(2018,1,1).
Alternative code:
let
Source = Table.FromColumns({{Number.From(#date(2017,1,1))..Number.From(#date(2018,1,1))}}),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}})
in
#"Changed Type"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |