I have a DAX code that works, but now I want to create a new measure so that I can see the same thing for the previous year. This way, I can have two measures with rolling sales in the same graph.
<code>R12 months =
</code>
<code>R12 months =
</code>
R12 months =
VAR MaxDate = LASTDATE(d_date[date])
VAR MinDate = SAMEPERIODLASTYEAR(MaxDate)
VAR Result =
CALCULATE(
[Store sale],
FILTER(ALL(d_date),
d_date[date] <= MaxDate &&
d_date[date] > MinDate)
)
RETURN
Result