Forum Discussion
MTrullàs
Helper III
3 years agoAverage 7 last inputs
I have a PBI with a metric for calculate inputs. ENTRADAS = CALCULATE( [Coches], USERELATIONSHIP( STOCK_EVOLUTION[Fecha_entrada_calculada],'DimDate'[Date])) ...
- 3 years ago
Hi again MTrullàs ,
Not so easy to guess what your [Coches] measure do, but could you please give this a try?
If we say that [Coches] = SUM ( Table[Column] )
Then you can try this:PROMEDIO_ENTRADAS_7 =VAR __LastDate =MAX ( STOCK_EVOLUTION[Date] )VAR __Last7dates =TOPN ( 7, FILTER ( ALL ( STOCK_EVOLUTION[Date] ), STOCK_EVOLUTION[Date] <= __LastDate ), STOCK_EVOLUTION[Date], DESC )VAR __Result =CALCULATE ( AVERAGEX( STOCK_EVOLUTION, [Entradas] ), __Last7dates )RETURN__ResultThis works for me, so if you cant make it work now, then I can send you an example pbix file.
BrMarius
mariussve1
Solution Sage
3 years agoHi,
Could you try this:
AVERAGEX(TOPN(7,'Table','Table'[Date],DESC),[ENTRADAS])
Br
Marius