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
ThomasWeppler
Super User
Super User

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

Top Kudoed Authors