Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
modxplus
Frequent 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 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

Last Week View.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Just do

 

Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)

 

--Nate

View solution in original post

3 REPLIES 3
Anonymous
Not 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

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

Anonymous
Not applicable

Just do

 

Table.SelectRows(PriorStepOrTableName,each Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Saturday)-1)

 

--Nate

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors