Forum Discussion
Regnbagar1
Helper I
4 years agoMeasure doesn't work with filters
Hi! I have created a measure that should calculate the SUM of the last three months. The measure only works for one of the countries when I use a dimension table as filter. In this case the measur...
- Anonymous4 years ago
Hi Regnbagar1 ,
Sorry for my late reply.
You could try the following to create a column:
Column = var _last3months=EOMONTH([yearmonth],-3) return CALCULATE(SUM('Table'[Value]),FILTER('Table',[country]=EARLIER('Table'[country]) && [yearmonth]>_last3months &&[yearmonth]<= EARLIER('Table'[yearmonth])))Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Regnbagar1 ,
Please try:
Sum of Last 3 Months =
VAR _last3months =
EOMONTH ( MAX ( 'Table'[yearmonth] ), -3 )
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALLSELECTED ( 'Table' ),
[country] = MAX ( 'Table'[country] )
&& [yearmonth] > _last3months
&& [yearmonth] <= MAX ( 'Table'[yearmonth] )
)
)
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regnbagar1
Helper I
4 years agoHi,
If I try to do exactly as you did I get this result instead.