Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola a todos
Tengo una mesa como:
Necesito añadir usando dax, una columna con promedio de los últimos 2 años como este:
¿Alguien sabe si esto es posible?
gracias
Solved! Go to Solution.
No @Rick_ferreira ,
Creo que al ser un promedio sería mejor hacer una medida sin embargo, pruebe la siguiente columna:
Average_last_ 2_year =
VAR year_ref =
YEAR ( 'Table'[Date] )
VAR month_ref =
MONTH ( 'Table'[Date] )
RETURN
IF (
year_ref - 2
>= MINX ( ALL ( 'Table'[Date] ), YEAR ( 'Table'[Date] ) ),
AVERAGEX (
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[Date] ) < year_ref
&& YEAR ( 'Table'[Date] ) >= year_ref - 2
&& MONTH ( 'Table'[Date] ) = month_ref
),
'Table'[Value]
)
)
No @Rick_ferreira ,
Creo que al ser un promedio sería mejor hacer una medida sin embargo, pruebe la siguiente columna:
Average_last_ 2_year =
VAR year_ref =
YEAR ( 'Table'[Date] )
VAR month_ref =
MONTH ( 'Table'[Date] )
RETURN
IF (
year_ref - 2
>= MINX ( ALL ( 'Table'[Date] ), YEAR ( 'Table'[Date] ) ),
AVERAGEX (
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[Date] ) < year_ref
&& YEAR ( 'Table'[Date] ) >= year_ref - 2
&& MONTH ( 'Table'[Date] ) = month_ref
),
'Table'[Value]
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |