Forum Discussion

12Bowers12's avatar
12Bowers12
Helper V
7 years ago
Solved

Measure based on another measure

Good afternoon, I am just learning PBI and paste two measures as below.  The first measure gets right result. The second meaure is based on the first measure but did not go through.  I get the Une...
  • Peter_R's avatar
    7 years ago

    If I interpret what you want that 2nd measure to do, it's to go through each policy and multiply by the proportion of a year that the policy has remaining, as of March 31. You then want to sum up all of these amounts across all policies - but only for a subset of policies that prior to March 31 and which had not expired by March 31.

    Try this:

    M2 Unearned Premium =
    SUMX (
        FILTER (
            Coverage,
            AND (
                Coverage[EFFECTIVE_DATE] <= DATE ( 2019, 3, 31 ),
                Coverage[EXPIRE_DATE] > DATE ( 2019, 3, 31 )
            )
        ),
        Coverage[ANNUAL_PREMIUM]
            * DIVIDE ( ( Coverage[EXPIRE_DATE] - DATE ( 2019, 3, 31 ) ), 365, 0 )
    )