Forum Discussion
DonPepe
Helper II
4 years agoConvert 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 ...
- 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]) ) )
KT_Bsmart2gethe
Impactful Individual
4 years agoHi DonPepe ,
Highlighted in blue is the day of the week.
List.Transform(List.Select({Number.From(StartDate)..Number.From(EndDate)}, each Date.DayOfWeek(Date.From(_))+1=2), each Date.From(_))
Regards
KT