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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Power query help

Am looking to create a column in power query editor that will take the monch a order was invoiced then based in the number of months that it needs to be invoiced for will give me the dates. For example;

 for an order invoiced on 23/04/2019 and the number of months being 3 the new column should give me 3 months worth of dates for example 23/05/2019 23/06/2019 23/07/2019. Below is a screenshot of the data i am trying to create this with. Any help will be gratefully appreciatedCapture.JPG

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion


Example tableExample table
Calculated columnCalculated column
Expand to new rowsExpand to new rows
Expanded tableExpanded tableNew calculated columnNew calculated columnResultResult


Connect on LinkedIn

View solution in original post

5 REPLIES 5
tex628
Community Champion
Community Champion

https://docs.microsoft.com/en-us/powerquery-m/list-dates

Create a new column with your month column as count and month as duration. Then expand into new rows.


Connect on LinkedIn
Anonymous
Not applicable

@tex628 thank you so much for the response so would it look like this

 

List.Dates([DateInvoiced],[Months], [Months] )

 

thank you

tex628
Community Champion
Community Champion

Nevermind that, apparently its not that simple.
It appear that list.dates cant use month as increment which leaves us with a more complicated solution. 

Use List.Numbers to create a record for each month. So you would do something along the lines of:

List.Numbers( 0 , [Month] )

https://docs.microsoft.com/en-us/powerquery-m/list-numbers

When the list is expanded you should end up with 1 record representing each month. 1, 2, 3, 4, 5 etc. 

Now you want to create a new column using:

Date.AddMonths( [DateInvoiced] , [New column that you just made] )

https://docs.microsoft.com/en-us/powerquery-m/date-addmonths

This should give you the desired result! Sorry for the missdirect in the beginning, hope it works out.

Br,
J


Connect on LinkedIn
Anonymous
Not applicable

@tex628  but wont that just give me the end date i need all the iterim dates in between as a list. Thank you for all your help

tex628
Community Champion
Community Champion


Example tableExample table
Calculated columnCalculated column
Expand to new rowsExpand to new rows
Expanded tableExpanded tableNew calculated columnNew calculated columnResultResult


Connect on LinkedIn

Helpful resources

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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