Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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 really big weird number for SPLY and current year looks okay. 

 

Measure = SUM(Table[Premium]) - CALCULATE(SUM(Table[Premium]) / 365 * (365 - SUM(Table[DateDiff])), Table[Cancel Date]>0 )

 

Where DateDiff = Calculated Column = DATEDIFF( Table[Inception Date], Table[Cancel Date], DAY) 

 

Policy NumberInception DateCancel DatePremiumDateDiff
A01/01/201930/06/2019$100Days: Incept - Cancel
B01/02/201925/10/2019$300As above
C05/01/202010/03/2020$500As above
D04/02/2020-$600As above

 

When I do the SPLY formula, I'm doing

SPLY = CALCULATE ( Measure , SAMEPERIODLASTYEAR ( Calendar ( date ) )

 

Is this correct, or am I doing it wrong because I'm getting an incorrect huge number for 2019, but 2020 looks okay. 

 

Thanks for any help. 

1 Reply