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
ThomasWeppler
Impactful Individual
Impactful Individual

Create a list with a start and an end date

Hi Power Bi community

I need to make a list for each row that show how many months have passed.

 

= Table.AddColumn(#"Filtered Rows2", "Month", each List.Generate(()=>[x=#date(2022,3,18)], each [x]<=#date(2025,6,24), each [x=Date.AddMonths([x],1)], each [x]))

 

I want to replace [x=#date(2022,3,18)] with the data from my colum Next_invoice_date
and

[x]<=#date(2025,6,24) with the data from my colum Expire_date

Can anyone help me with this?
All help will be greatly appreciated.

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi @ThomasWeppler 

 

= Table.AddColumn(#"Filtered Rows2", "Month",
(r) => List.Generate(
()=>[x=r[Next_invoice_date]],
each [x]<=r[Expire_date],
each [x=Date.AddMonths([x],1)],
each [x]
)
)

Stéphane 

View solution in original post

2 REPLIES 2
slorin
Super User
Super User

Hi @ThomasWeppler 

 

= Table.AddColumn(#"Filtered Rows2", "Month",
(r) => List.Generate(
()=>[x=r[Next_invoice_date]],
each [x]<=r[Expire_date],
each [x=Date.AddMonths([x],1)],
each [x]
)
)

Stéphane 

Thanks a lot for the help. 🙂

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.