Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi guys,
I'm trying to use SAMEPERIODLASTYEAR to see selected week based on slicer for This Year (TY) and Last Year (LY), however, when I select the week, it seems to reflect in TY column only but not in LY column as screenshot below (example here is I selected week 4)
I am trying to ensure that LY Week Selected also shows the number that is filtered in "Week" Slicer (or Max number of week if multiple weeks are selected in Slicer)
TY Week Selected =
if(ISFILTERED('Calendar Table'[Week Number]),MAX('Calendar Table'[Week Number]),MAX('Sales Table'[Latest Week Number]))
LY Week Selected = CALCULATE([Dummy Value],SAMEPERIODLASTYEAR('Calendar Table'[Date]))
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but when searching for last year's same week number value, please try something like below.
LY selected week sales: =
VAR _currentyear =
MAX ( 'calendar'[Year] )
VAR _lastyear = _currentyear - 1
VAR _selectedweeknumber =
MAX ( 'calendar'[Week number] )
VAR _lastyearperiod =
FILTER (
ALL ( 'calendar' ),
'calendar'[Year] = _lastyear
&& 'calendar'[Week number] = _selectedweeknumber
)
RETURN
IF (
HASONEVALUE ( 'calendar'[Year] ),
CALCULATE ( [This year selected week sales:], _lastyearperiod )
)
Hi,
I am not sure if I understood your question correctly, but when searching for last year's same week number value, please try something like below.
LY selected week sales: =
VAR _currentyear =
MAX ( 'calendar'[Year] )
VAR _lastyear = _currentyear - 1
VAR _selectedweeknumber =
MAX ( 'calendar'[Week number] )
VAR _lastyearperiod =
FILTER (
ALL ( 'calendar' ),
'calendar'[Year] = _lastyear
&& 'calendar'[Week number] = _selectedweeknumber
)
RETURN
IF (
HASONEVALUE ( 'calendar'[Year] ),
CALCULATE ( [This year selected week sales:], _lastyearperiod )
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.