Forum Discussion
Anonymous
5 years agoNot applicable
Use yearaverage as target line
Hi all, i'm facing a new issue. The customer would like to see the average of 2 years ago as a constant targetline in the chart. So i created the average of 2 years ago: Norm eigenvertragi...
- 5 years ago
Anonymous , Try like
Norm eigenvertraging =
var _1 = maxx(allselected('Date'), 'Date'[Date])
var _2= year(_1) -2
return
CALCULATE(AVERAGE('Vertraging'[eigenvertraging])
,filter(all('Date') year('Date'[Date]) = _2
)) - 5 years ago
Hi Anonymous ,
You could try the following measure:
TEST1 = VAR LASTTWOYEARDAY = DATE ( YEAR ( TODAY () ) - 2, MONTH ( TODAY () ), DAY ( TODAY () ) ) VAR TEST1 = CALCULATE ( AVERAGE ( Vertraging[eigenvertraging] ), FILTER (ALL('Date'),'Date'[Date]<=LASTTWOYEARDAY) ) RETURN TEST1Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Best Regards
Lucien
amitchandak
5 years agoSuper User
Anonymous , Try like
Norm eigenvertraging =
var _1 = maxx(allselected('Date'), 'Date'[Date])
var _2= year(_1) -2
return
CALCULATE(AVERAGE('Vertraging'[eigenvertraging])
,filter(all('Date') year('Date'[Date]) = _2
))