Forum Discussion
nolan0716
3 years agoRegular Visitor
Not capturing values using dateadd
Hi, So I was comparing the current value (Opportunity) and the value 3 months prior (PrevQuarterOPP) using the dateadd function but its not getting the correct value or should I say its not captu...
Anonymous
3 years agoNot applicable
Hi nolan0716 ,
You can try code as below to create a measure.
PreviousQuarterOPP =
VAR _SELECTDATE =
MIN ( 'TableName'[Updated Month] )
VAR _RangeStart =
EOMONTH ( _SELECTDATE, -4 ) + 1
RETURN
CALCULATE (
SUM ( 'TableName'[Opportunity] ),
FILTER (
ALL ( 'TableName' ),
'TableName'[Updated Month] >= _RangeStart
&& 'TableName'[Updated Month] < _SELECTDATE
)
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- nolan07163 years agoRegular Visitor
Hi Anonymous
this is what I got from your code