Forum Discussion
MAMENZAL
4 years agoFrequent Visitor
MEDIA MOVIL
Buenos días soy nueva aquí, y en Power Bi, necesitaría ayuda con una formula que no entiendo lo que me esta pasando. Tengo que calcular la media móvil acumulada de ingresos por empleado. Para ello ...
Anonymous
4 years agoNot applicable
Hi MAMENZAL ,
You can create a table to extract date value and use it as the category of your visual.
Then you can write a measure formula to extract the current date value as a condition to looping table records and get cumulative results.
measure =
var _select=MAX('Date'[Date])
return
AVERAGEX(
FILTER(
SUMMARIZE(ALL('Table'),
'Table'[Date],'Table'[Staff],
"Avg value",AVERAGE('Table'[amount])),
'Table'[Date] >=DATE(YEAR(_select)-1,MONTH(_select),DAY(_select))&&
'Table'[Date]<=_select&&'Table'[Staff]=MAX('Table'[Staff])),
[Avg value])
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.