Forum Discussion
mgrayTCB
Helper IV
4 years agoContext transition with variable
when i calculate this average with two separate measures it works correctly but when I try to combine it into one meaure with an extra variable it stops working correctly. I am trying to calculate th...
- 4 years ago
mgrayTCB try this:
MS Months Chg2 = AVERAGEX ( FILTER ( ADDCOLUMNS ( Project, "@datechg", VAR SSdate = CALCULATE ( MINX ( MilestoneSS, MilestoneSS[DateActOrEstSS] ) ) VAR Curdate = CALCULATE ( MAXX ( Milestones, Milestones[DateActOrEst] ) ) VAR datechg = DATEDIFF ( SSdate, Curdate, DAY ) / 30.4 RETURN datechg ), [@datechg] <> 0 ), [@datechg] )
Whitewater100
Solution Sage
4 years agoHi:
I beleive it's due to having multiple iterators with calculate.
Would somehing like this work?
CombinedMeasure = IF([MS Months Chg]<>0, [MS Months Change], BLANK())
- mgrayTCB4 years ago
Helper IV
the combined measure that is not working is the one with the variable datechg. I tried that if statement there but it does not help. Any other ideas?
- Whitewater1004 years ago
Solution Sage
Hi:
If you have sample data it will be easier to try to solve. Thank you.
- mgrayTCB4 years ago
Helper IV
See the sample data here
https://drive.google.com/file/d/1F-60fTrgFjDy53ycBb7uqlwDEjcNleP1/view?usp=sharing
Why does the two step measure approch provide the correct average while the AllInOneMeasure does not.