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

How do I add a number of months equal to the value in a colum?

Hi Power BI Community

 

I have this column generates a list of months between two dates.

However I want the list to be diffrent based on a value called periodes that determines how many months the list should jump between each row.

 

Now I have this code.

 

= 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]))

 

But I want the number 1 to be repalce with the value in a colum called Period

Does anyone knows how to do that?

All help will be greatly appreciated.

1 ACCEPTED SOLUTION
slorin
Super User
Super User

@ThomasWeppler 

1 --> r[Period]

r = actual row

 

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

 Stéphane

View solution in original post

2 REPLIES 2
slorin
Super User
Super User

@ThomasWeppler 

1 --> r[Period]

r = actual row

 

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

 Stéphane

Thanks again. 🙂

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 Solution Authors