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.
Tengo datos que se cuantifican año y mes. Se me pide que muestre la suma de 12 meses rodantes. ¿Puede guiarme cómo se puede lograr?
Anteriormente trabajé con una tabla de fechas y calculé la suma móvil. Pero aquí no tengo ningún valor de fecha.
Estos datos tienen año y mes.
mediante el uso de
@KrishnaNags
@KrishnaNags
Agregue una nueva columna a la tabla para crear un Año+Mes
YearMonth = 'Table'[YEAR] * 100 + 'Table'[MonthNumber]
Cree la siguiente medida:
Rolling 12M Incident Rate =
VAR __Relation =
ADDCOLUMNS (
ALLSELECTED (
'Table'[YEAR],
'Table'[MonthName],
'Table'[MonthNumber],
'Table'[YearMonth]
),
"@IncRate", [Total Incident Rate]
)
VAR __Window =
WINDOW ( -11, REL, 0, REL, __Relation, ORDERBY ( 'Table'[YearMonth] ) )
VAR __Result =
CALCULATE ( [Total Incident Rate], __Window )
RETURN
IF ( COUNTROWS ( __Window ) >= 12, __Result )
Aquí está el resultado, archivo adjunto a continuación.
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 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |