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
Hello,
I need to generate a rolling calendar lookup table (that I need to add columns to) where today would be the middle date. Ideally, it would be 90 days before today and 30 days in the future.
I was helped on here the other day with creating a rolling 90 day calendar, but I wasn't able to pick through the code to add the future 30 days as well.
let
Source =
{
Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()), -90))..
Number.From(DateTime.Date(DateTime.LocalNow()))
},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}})
in
#"Changed Type"
Any help is appreciated!
Solved! Go to Solution.
Hi @Imthedan
use the following M-Code:
// DateRange
let
Source =
{Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()), -90))..
Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()), 30))
},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}})
in
#"Changed Type"
Regards FrankAT
Hi @Imthedan
use the following M-Code:
// DateRange
let
Source =
{Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()), -90))..
Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()), 30))
},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}})
in
#"Changed Type"
Regards FrankAT
Thank you!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |