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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi Experts
I have found a calendar in this formun that I like, but want to make a change to the start date. I would like the start date fixed to 2019,1,1 and the end date dynamic like in the code (current year plus 12 months)
Can someone please help me change the below to code?
let
Source = List.Dates(StartDate, DurationDays, #duration(1, 0, 0, 0)),
StartDate = DateTime.Date(Date.StartOfMonth(Date.AddMonths(DateTime.LocalNow(),-1))),
EndDate = DateTime.Date(Date.EndOfMonth(Date.AddMonths(DateTime.LocalNow(),12))),
DurationDays = Duration.Days(EndDate - StartDate),
ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(ToTable,{{"Column1", "Date"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
#"Changed Type"
Thanks
Solved! Go to Solution.
Here you go.
let
Source = List.Dates(StartDate, DurationDays, #duration(1, 0, 0, 0)),
StartDate = #date(2019,1,1),
EndDate = Date.From(Date.EndOfYear(Date.AddMonths(DateTime.LocalNow(),12))),
DurationDays = Duration.Days(EndDate - StartDate),
ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(ToTable,{{"Column1", "Date"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
#"Changed Type"
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Here you go.
let
Source = List.Dates(StartDate, DurationDays, #duration(1, 0, 0, 0)),
StartDate = #date(2019,1,1),
EndDate = Date.From(Date.EndOfYear(Date.AddMonths(DateTime.LocalNow(),12))),
DurationDays = Duration.Days(EndDate - StartDate),
ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(ToTable,{{"Column1", "Date"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
#"Changed Type"
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks, Pat
Worked just as how I wanted
Much appreciated
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.