Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Imthedan
Helper II
Helper II

Generating Rolling Calendar Lookup Table with TODAY as middle date.

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!

 

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

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

View solution in original post

2 REPLIES 2
FrankAT
Community Champion
Community Champion

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!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.