Forum Discussion
Anonymous
6 years agoNot applicable
Datediff v SPLY
Hi all, Essentially, what I'm trying to do is calculate the premium that has been written, and exclude the premium that occurred as a result of the cancellation of the policy but I'm getting a re...
- Anonymous6 years ago
Hi. Thanks everyone for your suggestions.
I found out the issue wasn't in the SPLY formula, where I simply used sameperiodlastyear calc. The Datediff formula was giving me grief and apparently you can't SUM the datediff, when I used AVERAGE datediff, it gave me the appropriate number and the measure then worked.
v-alq-msft
Community Support
6 years agoHi, Anonymous
You may try the following measure.
SPLY =
var _currentyear = YEAR(MAX('Table'[Inception Date]))
return
CALCULATE(
[Measure],
FILTER(
ALLSELECTED('Table'),
YEAR('Table'[Inception Date]) = _currentyear-1
)
)
Here is the result.
If I misunderstand your thought, please show me your expected result. Thanks.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.