Sales-PW = VAR CurrentWeek = SELECTEDVALUE( 'Calendar'[WeekNo] ) VAR CurrentYear = SELECTEDVALUE( 'Calendar'[Year] ) VAR MaxWeekNo = CALCULATE( MAX ( 'Calendar'[WeekNo] ), ALL ( 'Calendar' ) ) RETURN SUMX( FILTER( ALL ( 'Calendar' ), IF ( CurrentWeek = 1, 'Calendar'[WeekNo] = MaxWeekNo && 'Calendar'[Year] = CurrentYear -1, 'Calendar'[WeekNo] = CurrentWeek -1 && 'Calendar'[Year] = CurrentYear ) ), [Total Sales] )
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter