Forum Discussion
modxplus
3 years agoFrequent Visitor
FIlter to Last Week Only
I am trying to set filter this table to a "Last Week Only" view. I cant use the normal filter to last week due to the fact that my weeks run from Saturday to Friday and the date filter in Power Que...
- Anonymous3 years ago
Just do
Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)
--Nate
Anonymous
3 years agoNot applicable
For your Week Number Column, your formula should be Table.AddColumn(PriorStepOrTableName, "Week Number", each Date.WeekOfYear([Date], Day.Saturday), Int64.Type)
That makes Saturday your first day of the week.
--Nate
- modxplus3 years agoFrequent Visitor
Perfect. Yes that worked and has Sat as the first day of the week now.
Do you know how you would do the second piece where i can do a Week Number = Last Week Number then 1 else 0 formula to only filter to last week
- Anonymous3 years agoNot applicable
Just do
Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)
--Nate