Forum Discussion
Context transition with variable
- 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] )
In case it answered your question, please accept the solution to help other members find it. Appreciate Your Kudos.Showcase Report – Contoso By SpartaBI
Visit SpartaBI website Visit SpartaBI Linkdin Visit SpartaBI Facebook
SpartaBI Logo
Hi:
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.