I'm trying to create a measure that is the sum of the last 7 days with sales data.
The following code only works as desired when sales data is recent and there are no date filters that clash.
CALCULATE([Sold Dollars],
'calendar'[Date] <= TODAY()-1) && 'calendar'[Date] >= TODAY()-7)
I tried this code:
CALCULATE([Sold Dollars],
'calendar'[Date] <= MAX('calendar'[Date])-1
&& 'calendar'[Date] >= MAX('calendar'[Date])-7)
But it returns an error message:
A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
What can I do to create a measure that is filtered to the top seven ALLSELECTED dates?