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

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.

Reply
Gdh1091
Regular Visitor

Creating a measure with a varying equation based on year

Hi there,

 

Apologies if this is a fairly basic request but I'm quite new to building DAX expressions.

 

I'm trying to create a measure to calculate the reinsurance premium from two tables which I've posted at the bottom.

 

Reinsurance Premium is caluculated using the equation: [Original Premium]*0.8*[Share of Contract]

 

The idea of the measure is create a situation where if a user were to filter on one of the reinsurers in Table 2, then they will be shown the total reinsurance premium assosiated with that insurers shares across all years (or a particular year if the user selects this).

 

My issue is I can get the [Original Premium] to multiply by the sum of the entire [Share of Contract] column in Table 2, but I can't limit it to just multiply according to the total of the relevent year's [Share of Contract] (which should always total 1 when the dashboard is unfiltered).

 

Whats happening now (as if unfiltered and showing all years):

Original Premium200
Equation200*0.8*2       (2 is the total for the [Share of Contract] column for both years)
Reinsurance Premium320      (Twice what it should be)

 

What should be happening:

Original Premium200
Equation

100*0.8*1       (1 is the total of [Share of Contract] for 2017)

+

100*0.8*1       (1 is the total of [Share of Contract] for 2018)

Reinsurance Premium160

 

I may not have explained this too well, but if you've got any idea what I'm on about and can help then I'd appreciate it.

 

Cheers!

 

Table 1:

 

Original PremiumYear
1002017
1002018

 

Table 2:

 

YearReinsurerShare of Contract
2018Aspen Re0.208800
2018AXA XL Bermuda0.002113
2018AXA XL Syndicate0.043373
2018Everest Re0.118098
2018MS Amlin Syndicate0.203352
2018Partner Re0.148871
2018Ren Re0.044449
2018Scor0.211812
2018Trans Re0.019133
2017Aspen Re0.011959
2017AXA XL Bermuda0.061815
2017AXA XL Syndicate0.054838
2017Everest Re0.105854
2017MS Amlin Syndicate0.174294
2017Partner Re0.140202
2017Ren Re0.263262
2017Scor0.059229
2017Trans Re0.128547
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The attached solution assumes that the share of contract for a year always adds up to 1.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

The attached solution assumes that the share of contract for a year always adds up to 1.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.