I'm using code from Chris Webb: Source
and here is the sample code from his site:
Ranges = {
{"Today",
TodaysDate,
TodaysDate,
1},
{"Current Week To Date",
Date.From(Date.StartOfWeek(TodaysDate)),
TodaysDate,
2},
{"Current Month To Date",
Date.From(Date.StartOfMonth(TodaysDate)),
TodaysDate,
3},
{"Current Year To Date",
Date.From(Date.StartOfYear(TodaysDate)),
TodaysDate,
4},
.......
I'm looking to get the previous week dates. I tried:
{"Previous Week",
dates.AddWeeks(Date.From(Date.StartOfWeek(TodaysDate,Day.Thursday)),-1),
TodaysDate,
4},
Which works but of course it also adds the dates for the current week (which is Thursday to Thursday in my case). Any ideas about only getting the previous week based on this method? Possibly subtracting the dates from the current week and previous week?
I'm not trying to do week flags or use DAX or R. Preferably in this format.
Anything would help!!! Thanks!