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:
Total Sales, previous period = CALCULATE([Total Sales],REMOVEFILTERS('Date'[Year]),USERELATIONSHIP(Date_Previous[Date],'Date'[Date]))
After addig slicers from both the Date field's Year column and Date_Previous field's Year column, I get this result:
I tried to replace REMOVEFILTERS('Date'[Year]) with REMOVEFILTERS('Date'[Date]), but I didn't quite get the desired result as well:
Could you please help me with this issue?