Forum Discussion

DonPepe's avatar
DonPepe
Helper II
4 years ago
Solved

Convert List in Function

Hi,    My goal is to get all the working date for a service from a given Start date and a given End date knowing that I know only the day of week and the service validity.  Parameters :   Start ...
  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    4 years ago

    Use this

    Table.AddColumn(
       Source, 
       "DateList", 
       each List.Select(
          List.Dates(
             Date.FromText(StartDate), 
             Duration.Days(Date.FromText(EndDate) - Date.FromText(StartDate)) + 1, 
             #duration(1, 0, 0, 0)
          ), 
          (x)=> Date.DayOfWeek(x) = Number.From([DAY_IN_WEEK])
       )
    )