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
Anonymous
Not applicable

List.Dates between dates

I am looking for a formula that will look at the added date and number of months then add a column for each month. For example Added date is 25/06/2007 and the number of months is 5 the 1st column would be added date +1 2nd columns would be added date +2 up to the number of months. Obviously the number of months will change dummy date below for exmaple.

 

Capture.JPG

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

try this code, you will need to replace the blue part to match your queries

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNA1MNQ1MFbSUTJWitUBC5nrGpjoGpgChcyUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Added Date" = _t, #"Number Months" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Added Date", type date}, {"Number Months", Int64.Type}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom", each Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Table.AddColumn(Table.ExpandListColumn(#table( type table [Date=date,Days=date], {{[Added Date], {1..[Number Months]}}}), "Days"), "Custom", each Date.AddMonths([Date],[Days])), {"Custom"}),{{"Custom", type text}}))),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom1", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Custom.1", "Custom.2", "Custom.3", "Custom.4", "Custom.5", "Custom.6"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type date}, {"Custom.2", type date}, {"Custom.3", type date}, {"Custom.4", type date}, {"Custom.5", type date}, {"Custom.6", type date}})
in
    #"Changed Type1"


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

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

try this code, you will need to replace the blue part to match your queries

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNA1MNQ1MFbSUTJWitUBC5nrGpjoGpgChcyUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Added Date" = _t, #"Number Months" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Added Date", type date}, {"Number Months", Int64.Type}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom", each Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Table.AddColumn(Table.ExpandListColumn(#table( type table [Date=date,Days=date], {{[Added Date], {1..[Number Months]}}}), "Days"), "Custom", each Date.AddMonths([Date],[Days])), {"Custom"}),{{"Custom", type text}}))),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom1", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Custom.1", "Custom.2", "Custom.3", "Custom.4", "Custom.5", "Custom.6"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type date}, {"Custom.2", type date}, {"Custom.3", type date}, {"Custom.4", type date}, {"Custom.5", type date}, {"Custom.6", type date}})
in
    #"Changed Type1"


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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