cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

List.Dates Make the Starting date today?

I'm using List.Dates to create a list of future dates within the query editor. Is there a way I can make the line below dynamic to have the starting date be whatever today's date is?

 

= #"Future Date List"(#date(2019, 2, 22), 730, #duration(1, 0, 0, 0))
1 ACCEPTED SOLUTION
Memorable Member
Memorable Member

Hi @nobodyukno,

 

try following PowerQuery query. It creates the start date from parts of your local DateTime.

 

= List.Dates(#date(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()), Date.Day(DateTime.LocalNow())), 730, #duration(1, 0, 0, 0))

 

View solution in original post

2 REPLIES 2
Super User III
Super User III

Use DateTime.LocalNow() to get today's date. Equivilant to TODAY() in Excel or DAX. You may need to wrap it in DateTime.Date() to just get the date, so the entire function might be:

 

= #"Future Date List"(DateTime.Date(DateTime.LocalNow()), 730, #duration(1, 0, 0, 0))


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Memorable Member
Memorable Member

Hi @nobodyukno,

 

try following PowerQuery query. It creates the start date from parts of your local DateTime.

 

= List.Dates(#date(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()), Date.Day(DateTime.LocalNow())), 730, #duration(1, 0, 0, 0))

 

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors