Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DA1981
Frequent Visitor

Sum calculation filtered on multiple dates

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.

 

Table.PNG

 

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!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DA1981 , refer if one the two blog can help you

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@DA1981 , refer if one the two blog can help you

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors