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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JRM-34
Regular Visitor

Power BI measure help - Sum for all dates prior and by YYYYMM

I have two tables. One has the date the agreeement was made and the other is the date a claim was paid. I need a measure that can create a table where we have all agreement years and the total amount paid with the claims paid for that YYYYMM. Here is an example below.

 

I have a date table where I linked the date of originiation and the claim paid date to the calendar date table.

 

 

I am getting hung up how I can create measure to show the information. I need the YYYYMM and the total of all agreeements by Agreeement Year. I also need the claims paid by YYYYMM but ignore the agreement year.

 

I have tried numerous measure and I can get them to show on their own but not in the same table.

I know I am probably missing something minor but I just cannot figure it out. 

 

Thank you for your help. 

 

Total OS Table
Date of OriginationAgreement NumberAgreement Year

Amount

Paid

1/1/2021123452021100
5/2/2021234562021500
8/10/2021345672021600
2/1/2022789102022100
4/5/2022987652022800
6/15/2022258692022900
4/1/2023123572023900
6/9/2023258962023700
11/2/2023268942023300
3/1/2024124892024500
3/2/2024156982024300
3/16/2024102582024

200

 

 

 

 

Claims Table
Claim Date PaidAgreement NumberPaid Claim Amount
1/1/202412345100
1/2/202423456300
1/3/202434567100
2/14/202478910100
1/4/202498765200
1/5/202425869100
1/6/202412357600
2/5/202425896100
2/10/202426894200
1/7/202412489100
1/8/202415698200
1/9/202410258100
2/6/202412345200
2/7/202423456100
2/8/202434567200
2/11/202478910400
2/12/202498765500
2/13/202425869100
1/10/202412357200
1/11/202425896100
1/12/202426894200
2/9/202412489100

 

 

 

Final Output
YYYYMMAgreement YearTotal Amount Paid for each YYYYMM by Agreement YearClaims paid in YYYYMM by Agreement Year
20240120211200500
20240120221800900
20240120231900400
20240120241000500
20240220211200100
20240220221800300
202402202319001500
20240220241000100
1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @JRM-34 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column on Claims Table.

YYYYMM = YEAR([Claim Date Paid])*100+MONTH([Claim Date Paid])

(3) We can create a model relationships and a measure.

vtangjiemsft_0-1715135667490.png

Claims paid = CALCULATE(SUM('Claims Table'[Paid Claim Amount]),USERELATIONSHIP('Claims Table'[Agreement Number],'Total OS Table'[Agreement Number]))

(4) Then the result is as follows.

vtangjiemsft_1-1715135723572.png

 

If the result is inconsistent with your expected result, please give an example of your calculation logic.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @JRM-34 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column on Claims Table.

YYYYMM = YEAR([Claim Date Paid])*100+MONTH([Claim Date Paid])

(3) We can create a model relationships and a measure.

vtangjiemsft_0-1715135667490.png

Claims paid = CALCULATE(SUM('Claims Table'[Paid Claim Amount]),USERELATIONSHIP('Claims Table'[Agreement Number],'Total OS Table'[Agreement Number]))

(4) Then the result is as follows.

vtangjiemsft_1-1715135723572.png

 

If the result is inconsistent with your expected result, please give an example of your calculation logic.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.