Hi,
I'm having troubles creating the function I mentioned in the topic.
1. I created a new table, Date_Previous = 'Date', so I got a copy of my original Date.
2. I chose Model View, and I created a 1-to-1 inactive relationship between Date(Date) and Date_Previous(Date) - Cross Filter direction: Both, otherwise it won't let me create it:
3. I created a new measure for Total Sales, previous period:
I tried to replace REMOVEFILTERS('Date'[Year]) with REMOVEFILTERS('Date'[Date]), but I didn't quite get the desired result as well:
Not sure you need the additional table. You could just use
Sales prev year =
CALCULATE ( [Total sales], PREVIOUSYEAR ( 'Date'[Date] ) )
Unfortunately, it is specifically requested to use the USERELATIONSHIP and the REMOVEFILTERS functions, that's why I'm trying to make this work this way.