Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time 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 Query runs Sunday to Saturday.
I am sure there is an easier way to do this but my thought process:
- I have a list view of dates with a week number that corresponds to the Sat to Fri
- The "Date Check" will populate a 1 on todays date
- The Last Week Number is just the week number minus the 1
**My problem is i am trying to get a custom column there in the "Last Week Check" so when Week Number = Last Week Number then 1 else 0. Then i can just filter to the 1 in that column and always be able to show last week. But I cant get that matching column to work correctly and have the highlighted rows in the "last week check" populate anything
Solved! Go to Solution.
Just do
Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)
--Nate
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
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
Just do
Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)
--Nate