Forum Discussion
Anonymous
4 years agoNot applicable
Filter days based on weekday
Hi Everyone, I have a scenario wherein I want to filter the data on date column based on current day in the query editor. If refreshing on Monday, filter data from last 3 days(Sunday, Saturda...
- 4 years ago
Anonymous , Try = Table.SelectRows(#"Added Custom", each [StartDate] >= Date.From(Date.AddDays(DateTime.LocalNow(), (-1 * (if Date.DayOfWeek(DateTime.Date(DateTime.FixedLocalNow())) =0 then 3 else 1 )))))
Anonymous
4 years agoNot applicable
Thanks Amit. I tried the formula & unfortuantely got a syntax error. Please assist
amitchandak
4 years agoSuper User
Anonymous , Try = Table.SelectRows(#"Added Custom", each [StartDate] >= Date.From(Date.AddDays(DateTime.LocalNow(), (-1 * (if Date.DayOfWeek(DateTime.Date(DateTime.FixedLocalNow())) =0 then 3 else 1 )))))
- Anonymous4 years agoNot applicable
This works like a charm. Had to change the DayOfWeek to get the desired results. Thanks a ton!!