Forum Discussion
Last Year This/Same Week
- Anonymous9 years ago
How is [Week Year ID] stored? Could you build last years [Week Year ID] by making use of the same one you used in your TWTY measure?
For Example if [Week Year ID] is YYYYWW you could build the string using a combination of LEFT and RIGHT to get the Year and Week components, then decrement the YYYY by one and build a new filter string from there.
How is [Week Year ID] stored? Could you build last years [Week Year ID] by making use of the same one you used in your TWTY measure?
For Example if [Week Year ID] is YYYYWW you could build the string using a combination of LEFT and RIGHT to get the Year and Week components, then decrement the YYYY by one and build a new filter string from there.
Hello Anonymous
Your approach works well, I changed the measure seems to works well:
PYTW Units = CALCULATE([Total Units],FILTER(ALL('CALENDAR'),'CALENDAR'[Week Year ID]=MAXX('CALENDAR','CALENDAR'[Week Year ID]-100)))-100 to get the same week previous week
Thank you