Forum Discussion
2366
Helper I
4 years agoFilter Dates in Previous Week
Hello, How do I filter dates in last week (Monday to Sunday) in DAX? Thanks
- Anonymous4 years ago
Hi 2366
Check the formulas.
weekdays = WEEKDAY('Table'[date],2) weekstart = 'Table'[date]-'Table'[weekdays]+1 lastweekstart = 'Table'[weekstart]-7Combine three formulas:
Column =var week_day = WEEKDAY('Table'[date],2)var week_start = 'Table'[date]-week_day+1returnweek_start-7Best Regards,Jay
2366
Helper I
4 years agoI have something similar which works if all the dates in last week are in the same year but if you have dates from two different year in previous week the above solution wont work?
For example - last week dates include 27/12/2021 to 02/01/2022
amitchandak
Super User
4 years ago2366 , it should, as we are using week rank, not the week number