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! Learn more

Reply
askspepsi
Helper II
Helper II

Power Query Start date to today

Greeting All,

 

IdStart DateDate Master
101/05/202101/05/2021
101/05/202102/05/2021
101/05/202103/05/2021
101/05/202104/05/2021
101/05/202105/05/2021
101/05/202106/05/2021
101/05/202107/05/2021
101/05/202108/05/2021
101/05/202109/05/2021
101/05/202110/05/2021
101/05/202111/05/2021
101/05/202112/05/2021
101/05/202113/05/2021
101/05/202114/05/2021
101/05/202115/05/2021
101/05/202116/05/2021
101/05/202117/05/2021
101/05/202118/05/2021
101/05/202119/05/2021
101/05/202120/05/2021
101/05/202121/05/2021
101/05/202122/05/2021
101/05/202123/05/2021
101/05/202124/05/2021
101/05/202125/05/2021
101/05/202126/05/2021
101/05/202127/05/2021
211/05/202111/05/2021
211/05/202112/05/2021
211/05/202113/05/2021
211/05/202114/05/2021
211/05/202115/05/2021
211/05/202116/05/2021
211/05/202117/05/2021
211/05/202118/05/2021
211/05/202119/05/2021
211/05/202120/05/2021
211/05/202121/05/2021
211/05/202122/05/2021
211/05/202123/05/2021
211/05/202124/05/2021
211/05/202125/05/2021
211/05/202126/05/2021
211/05/202127/05/2021

 

I have used the below query for 100days but I want to add today() function instead of 100.

Date Master=List.Dates([Start Date], 100, #duration(1, 0, 0, 0))

 

Please help to change this Query.

 

Thank you,

askspepsi

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@askspepsi 

Your formula is creating a list of dates from [Start Date] with 100 days. IF not 100 days, what exactly is required there?
Today is a Date, you a number. if you need today's date in PQ Date.From(DateTimeZone.LocalNow())

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@askspepsi 

Your formula is creating a list of dates from [Start Date] with 100 days. IF not 100 days, what exactly is required there?
Today is a Date, you a number. if you need today's date in PQ Date.From(DateTimeZone.LocalNow())

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

You are correct, my formula is creating for 100days, but for time being and to make the formula work I kept as 100days, but in reality, it should take today's date for example:- one employee starts from May 1st, 2021 then the date master should have 1st May 2021 to 27th May 2021 and when it is tomorrow the date master should be 1st May 2021 to 28 May 2021.

 

As you said to use Date.From(DateTimeZone.LocalNow()),

My Formula is now working fine, Thank you.

List.Dates([Start Date], Duration.Days(Date.From(DateTimeZone.LocalNow()) -[Start Date])+1 , #duration(1, 0, 0, 0))

amitchandak
Super User
Super User

@askspepsi , Try like

Date Master=List.Dates([Start Date], Duration.Days(today() -[Start Date]) , #duration(1, 0, 0, 0))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

I have got the below error

Expression.Error: The name 'today' wasn't recognized. Make sure it's spelled correctly.

@amitchandak 

Thanks for the reply,

Will today() function work in Power Query.

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors