Forum Discussion

EvaPBI's avatar
EvaPBI
Frequent Visitor
3 years ago
Solved

How to generate a new table by duplicating items from another table based on recurrence

Hi,    To facilitate data entry, I would like to generate a new table (Table 2) by duplicating items from another table (Table 1) based on the recurrence. Table 1 (Input - including recurrences)...
  • jbwtp's avatar
    jbwtp
    3 years ago

    Hi EvaPBI,

     

    This is the function which generates a list of dates between the start and end date with a given step:

     

    f = (Start, End, Step)=> List.Generate(()=>Start,  each _ < End, each Date.AddDays (_, Step) )

     

    You can use it as this:

    f(#date(2023, 1, 1), #date(2024, 11, 30), 14)

     

    Cheers,

    John