I have a table like:
I need to add using dax, an column with average of last 2 year like this:
Do someone know if this it possible to do?
Go to Solution.
Hi @Rick_ferreira ,
I believe that being an average you would be better making a measure however try the following column:
Average_last_ 2_year =
VAR year_ref =
YEAR ( 'Table'[Date] )
VAR month_ref =
MONTH ( 'Table'[Date] )
year_ref - 2
>= MINX ( ALL ( 'Table'[Date] ), YEAR ( 'Table'[Date] ) ),
ALL ( 'Table' ),
YEAR ( 'Table'[Date] ) < year_ref
&& YEAR ( 'Table'[Date] ) >= year_ref - 2
&& MONTH ( 'Table'[Date] ) = month_ref
Proud to be a Super User!
View solution in original post
Check out new user group experience and if you are a leader please create your group!
Check out how to claim yours today!
Test your skills now with the Cloud Skills Challenge.