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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Create rows for every date in date-range

Hello all

 

I have a table with a "from" and a "till" date. I need to generate a row for each date in that range, i think ive done this before but cant figure out how i did it.

 

Best regards

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

Add a custom column in Query Editor mode.

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

1.PNG2.PNG3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

Add a custom column in Query Editor mode.

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

1.PNG2.PNG3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft ,

Lets say for some rows i have from from and till date same, like from = "25/05/2022" and till = "25/05/2022". will it create only 1 row or multiple rows?

because i have a scenario where in i have some cases with from and till date as same data and other cases with different dates.

MattAllington
Community Champion
Community Champion

This may give you some ideas that you can adapt. https://exceleratorbi.com.au/expanding-rows-using-power-query/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Hi @MattAllington 

 

Ill take a look into it, thank you!

 

Just to add infos, every record/row in this table does have a from and till column. So the dates are not spreaded in the whole table.

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors