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
senencito
Frequent Visitor

Trying to calculate YTD Severity

Hi there,

 

I'm trying to calculateyearly severity starting from January. In thisexcel screenshot I have two examples that show what i'm getting vs what i'm supposed to get.

senencito_0-1632156194588.png

As you can see on the screenshot, I should be adding the number of paid claims from the previous months and dividing it by the amount of money paid over the same amount of months.


When I bring it to powerbi, having the month on the column makes it so the information is alwys filtered for the current month:

 

senencito_1-1632156293634.png

I already have it to filter just for the current year, but i'm not sure how to do the cumulative monthly comparison.

-- This is the code i'm using. runningTotal here refersto the cumulative YTD

runningTotal =
IF (YEAR(TODAY()) = YEAR(MAX(scs_claims_paid_totals[ClaimPaidDate])) ,
CALCULATE(
SUM(scs_claims_paid_totals[TotalPaid]) / DISTINCTCOUNT(scs_claims_paid_totals[ClaimNumber])
, YEAR(TODAY()) = YEAR(scs_claims_paid_totals[ClaimPaidDate]) , MONTH(date_dimension[Date]) <=(date_dimension[Month]) )
, 0)



would really appreciate any help that I can get with this.

3 REPLIES 3
Ehren
Employee
Employee

Hi senencito. This appears to be a DAX question, not a Power Query one. You might get more traction if you move this to the area of the forum for DAX questions.

v-eqin-msft
Community Support
Community Support

Hi @senencito ,

 

Since there are Measures not the original data according to the scrrenshots, please provide a data sample or share me with your pbix file after removing sensitive data.

Eyelyn9_0-1632363224323.png

 

Best Regards,
Eyelyn Qin

Hey all, apologies for the delay. I've uploaded a pbi file without sensitive information.

Also in the folder there's an Excel file i'm using as my data set. Would love all the help I can get.



https://www.dropbox.com/sh/uwitk60yfdnqc4o/AACDDIHUmihbzEiiOg1XqXsAa?dl=0

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.

Top Solution Authors