This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Morning,
I have a calculation to show a date range of the previous Sunday-Saturdy. Which I am using as a filter. However I need to take same date range and show it for the previous year. My Sun-Sat calc is:
_Is_Last_Week =
VAR TodayDate = TODAY()
VAR LastSaturday = TodayDate - WEEKDAY(TodayDate, 1)
VAR LastSunday = LastSaturday - 6
RETURN
IF(
'DimDate'[Date] >= LastSunday && 'DimDate'[Date] <= LastSaturday,
TRUE,
FALSE
)
Any thoughts on how to amend this for the same period last year?
Thanks
Solved! Go to Solution.
Hi @DCWork - you can simply shift the calculated LastSunday and LastSaturday back by 1 year using EDATE or DATEADD
use the below measure:
_Is_Last_Week_PY =
VAR TodayDate = TODAY()
VAR LastSaturday = TodayDate - WEEKDAY(TodayDate, 1)
VAR LastSunday = LastSaturday - 6
VAR LastSaturday_PY = EDATE(LastSaturday, -12)
VAR LastSunday_PY = EDATE(LastSunday, -12)
RETURN
IF (
'DimDate'[Date] >= LastSunday_PY &&
'DimDate'[Date] <= LastSaturday_PY,
TRUE,
FALSE
)
Hope this helps.
Proud to be a Super User! | |
Hi @DCWork - you can simply shift the calculated LastSunday and LastSaturday back by 1 year using EDATE or DATEADD
use the below measure:
_Is_Last_Week_PY =
VAR TodayDate = TODAY()
VAR LastSaturday = TodayDate - WEEKDAY(TodayDate, 1)
VAR LastSunday = LastSaturday - 6
VAR LastSaturday_PY = EDATE(LastSaturday, -12)
VAR LastSunday_PY = EDATE(LastSunday, -12)
RETURN
IF (
'DimDate'[Date] >= LastSunday_PY &&
'DimDate'[Date] <= LastSaturday_PY,
TRUE,
FALSE
)
Hope this helps.
Proud to be a Super User! | |
that's great, thanks for that.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 25 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 45 | |
| 20 | |
| 19 | |
| 18 |