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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
atin
Advocate III
Advocate III

Date Table and how to make it dynamic

Hi All 

 

I have been using this DATE table for some time and been using it for a Sales Table daily refresh.

 

How do I get the end date to be a dynamic one and not have future dates show in the table 

 

I know there is a DateTime.FixedLocalNow() formula that exists and I dont know where to insert this line in my current date table 

 

Many thanks

 

See Date Table details below: 

 

= (StartDate as date, EndDate as date, FYStartMonth as number) as table =>

  let

    DayCount = Duration.Days(Duration.From(EndDate - StartDate)) +1 ,

    Source = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),

    TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),  

    ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type date}}),

    RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Date"}}),

   

in

    AddFY

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @atin ,

 

You could try like this:

= Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZDLDcUwCAR78TkSBn+pxUr/bQS/KNr1u+EdgxjWSioqltXTtcvy1ve1kgGYmAEUgCrUUJG3Y1ID6MekDjC/cucDuYtmgEnL7hjEiUTlIPGRDGeUll+gbKiDCLmHB/f8QDy2I3UY8pDqAAUgvhOoAC4VeTsUlUg/FQvIYMN9X9P/c8WCCuCHXwHgYzUexcfqxyw+Vih+5H4A", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"start date" = _t, #"end date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"start date", type date}, {"end date", type date}}),
    Custom1 = Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
in
    Custom1

 2.PNG1.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @atin ,

 

You could try like this:

= Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZDLDcUwCAR78TkSBn+pxUr/bQS/KNr1u+EdgxjWSioqltXTtcvy1ve1kgGYmAEUgCrUUJG3Y1ID6MekDjC/cucDuYtmgEnL7hjEiUTlIPGRDGeUll+gbKiDCLmHB/f8QDy2I3UY8pDqAAUgvhOoAC4VeTsUlUg/FQvIYMN9X9P/c8WCCuCHXwHgYzUexcfqxyw+Vih+5H4A", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"start date" = _t, #"end date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"start date", type date}, {"end date", type date}}),
    Custom1 = Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
in
    Custom1

 2.PNG1.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @atin ,

 

use DAX to create the date table.

 

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors