Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 Uneared Premium though creating a calcuated column for InForce Premium but I prefer a measure solution for Unearned Premium.
I would like to thank you for any help.
Dennis
M1 InForce Premium =
CALCULATE (
SUM ( Coverage[ANNUAL_PREMIUM] ),
FILTER ( Coverage, Coverage[EFFECTIVE_DATE] <= DATE ( 2019, 3, 31 ) ),
FILTER ( Coverage, Coverage[EXPIRE_DATE] > DATE ( 2019, 3, 31 ) )
)
M2 Unearned Premium =
[M1 InForce Premium]
* DIVIDE ( ( Coverage[EXPIRE_DATE] - DATE ( 2019, 3, 31 ) ), 365, 0 )
Solved! Go to Solution.
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 ) )
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 ) )
Thank you, Peter,
That' great. I tried to add more criteria in the Filter but got a warning says Filter is limited to two criteria.
Any solutions?
Dennis
Thank you, Peter, I used && and to got it. A good night.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |