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
Odada
Regular Visitor

Challenge returning dates between my startdate and enddate in power query

Good day all,

pls i have a challenge trying to get the dates in between my start and end date, i used the custom column M function  {Number.from{startdate}..{number.from{enddate} and it gives me the following error

Expression error, we cannot apply an index of a type date

details=[function]

Index= 1/1/2023

Odada_1-1674092058124.png

 

 

 

5 REPLIES 5
Odada
Regular Visitor

Thank you for your reply, i have tried it and it returned only 1/1/2023

Odada_0-1674094082208.pngOdada_1-1674094118657.png

Is there something i can do pls

latimeria
Solution Specialist
Solution Specialist

Hi @Odada  ,

Try this

 

List.Dates([Targetdate] ,Number.From([EndTargetdate]-[Targetdate])+1,#duration(1,0,0,0))

latimeria_0-1674116430556.png

 

 

Thank you so much @latimeria

Odada
Regular Visitor

Thank you for your reply, i have tried it and it returned only 1/1/2023

Odada_0-1674094082208.pngOdada_1-1674094118657.png

Is there something i can do pls

adudani
Super User
Super User

@Odada ,

create a column subtracting the two dates you want to find the range between by selecting both columns and "From Date& Time" -> Date -> Subtract Days.

 

Then create a custom column using:

 

List.Dates({startdate, subtraction, #duration(0,0,0,1)})

Please accept this as the solution if this resolves your question.

 

Appreciate a thumbs up if this is helpful.

 


 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

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.