Forum Discussion

ThomasWeppler's avatar
ThomasWeppler
Icon for Impactful Individual rankImpactful Individual
2 years ago
Solved

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.

  • 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 

2 Replies

  • 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