Datefilter issue

I am trying to make a measure that will give me the total number of sales orders last year.

I have 4 page-level filters:
[CREATEDDATE] is in this year
[Dimension4_] is not “all risk konsept”
[SALESID] does not start with “R”
[SALESTYPE] is 3

I want a result that gives me the number of orders created last year, keeping filters for [DIMENSION4_], [SALESID] and [SALESTYPE], but of course I want to replace the filter for [CREATEDDATE] with this year-1

I have this DAX-fomula, but I keep getting the result “(Blank)”.

What am I doing wrong? (EDNA AI is no help)

Sales_LY =
CALCULATE(
COUNT(SALESTABLE[SALESID]);
FILTER(
ALL(SALESTABLE);
YEAR(SALESTABLE[CREATEDDATE]) = YEAR(TODAY()) - 1
&& SALESTABLE[DIMENSION4_] = SELECTEDVALUE(SALESTABLE[DIMENSION4_])
&& SALESTABLE[SALESID] = SELECTEDVALUE(SALESTABLE[SALESID])
&& SALESTABLE[SALESTYPE] = SELECTEDVALUE(SALESTABLE[SALESTYPE])
)
)

Hi @ceciliepetas ,

Welcome to the forum.

It’s much easier to add date dimension

and use DAX Time Intelligence function for this

Mora about DAX time Intelligence functions you can find at Mastering DAX course (and on several others)

And about how to create dimension table: