Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello all!
I am struggling to do a sum where the calculation is referencing 2 dates when trying to calculate the sum of insurance premium on a (historical) daily basis.
The ‘active premium’ on any given day (valuation date) will sum the premium of all policies that are ‘active’. Active is defined if the start date of the policy is on or before the valuation date and the end date is after the valuation date. Simply put, the policy is mid-term on that valuation date. Note that the valuation date is just a date, i.e. snapshot in time not a date range such as a month or quarter.
This is a boiled down data of what sample data looks like. If we used a valuation date of 01 March for example, we would sum the premium for policy 2 & 3 and the active premium for that date would be 250+50=300.
I have joined the above table to a date table on start date and end date. I dont know if this is causing a problem?
To calculate for today I would do the following calculation:
Active Premium = CALCULATE(
SUM(Book[Premium]),
Book[Start Date]<=TODAY(),
Book[End Date]>TODAY() )
I need this active premium calculated at every (valuation) date in the past 2 years, not just today, where I can then graphically represent it in a way that looks aesthetically pleasing, i.e. whether I want to look at snapshots at month end, quarter end, yearend or even a line graph with daily data points. I would like to use the dates in the date table as the historic valuation dates.
Quite new to Power BI and very new to DAX. Thanks in advance for any help!
Solved! Go to Solution.
@DA1981 , refer if one the two blog can help you
@DA1981 , refer if one the two blog can help you
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |