Forum Discussion
Week over Week Change
- 8 years ago
Hi Anonymous,
Try this measure please.
Measure = VAR lastWeekAmount = CALCULATE ( SUM ( Append1[Video Views] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[WeekNum] = MIN ( 'Calendar'[WeekNum] ) - 1 ) ) RETURN DIVIDE ( SUM ( Append1[Video Views] ) - lastWeekAmount, lastWeekAmount, 0 )I have upgraded the file here: https://1drv.ms/u/s!ArTqPk2pu-BkgROntwcC_mRlVBAU
Best Regards!
Dale
I used this but the calculation is not showing the right numbers. I have my Fiscal calendar all set with the correct fiscal week number. My guess it has something to do with week numbers the same between multiple fiscal years. Anybody encountered this and have a fix?
I happened to have a "Week offset" number instead of a week #, and so the solution from v-jiascu-msft worked well for me. The offset is -1 for last week, -2 for the week before, etc. it's nice for filtering to an 8 week running report, etc. And - it doesn't have an issue crossing years in this scenario.
On my 'Date' table - the code is just:
so - my measure looks like:
WoW Operationally Eligible =
VAR lastWeekAmount =
CALCULATE (
SUM ( FactScreening[OperationallyEligible] ),
FILTER (
ALL ( 'Date' ),
'Date'[Week Offset] = MIN ( 'Date'[Week Offset] ) - 1
)
)
RETURN
DIVIDE ( SUM( FactScreening[OperationallyEligible] )- lastWeekAmount, lastWeekAmount, 0 )