Forum Discussion
Ignoring a filter
Apologies for not explaining myself better in the title.
I can't do it in "Edit interactions" since I will have other columns related to the selected year.
In this particular column I'll be using an AVERAGEX of the sales amount but I'll looking for to ignore the sales amount of the current year (or the 2009 year) as per the example attached.
The measure I'm working on on my real report is the following:
# Cases Forecast- =
VAR CasesNoCY =CALCULATE (
[# Cases];
FILTER (
Cases ;
NOT ( ( YEAR ( Cases[Date] ) ) = YEAR ( TODAY () ) )
)
)
RETURN
CALCULATE(AVERAGEX(VALUES('Date'[Date]);CasesNoCY); ALL('Date'[Calendar Year]))The issue is that since in that table I have other columns using data for the current year, I can't filter it out for the visual.
The reason I need to eliminate the current year is to avoid using the actual Nr of Cases on the past dates for the current year forecast.
I hope that it makes sense.
Try
Sales NO CY =
var _year = SELECTEDVALUE('Date'[Year])
return
CALCULATE (
COUNTROWS ( Sales ),ALL('Date'[Year]),not('Date'[Year] =_year)
)- Anonymous6 years agoNot applicable
try the above - failing that, is this what you're looking for?
- setis6 years agoPost Partisan
Dear amitchandak and Anonymous ,
Thanks a lot for your answers. The solution proposed by amitchandak works perfectly in the example, but I must be doing something wrong in my real project, since I'm still getting blanks.
This is my measure:
# Cases Forecast-NotCY = VAR Year_selected = SELECTEDVALUE ( 'Date'[Calendar Year] ) RETURN CALCULATE ( AVERAGEX ( VALUES ( 'Date'[Date] ); CALCULATE ( [# Cases]; ALL ( 'Date'[Calendar Year] ); NOT ( 'Date'[Calendar Year] = Year_selected ) ) ) )My #Cases measure is just a DISTINTCOUNT for Cases ID.
would you be able to see why this isn't working for me here?
- amitchandak6 years agoSuper User
Are you trying to get Avg no cases per day ??