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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vkisa
Helper II
Helper II

Partly Cumulative Sum Measure in Matrix

Hi, 

I need some help to calculate cumulative sum in matrix.

I have income matrix by date1 and date2 columns as below. 

                                          Date2Month        

Date1YearDate1MonthFebruaryMarchAprilMayJune
2024February61-23867013
2024March 8170455
2024April  915942
2024May   9978
2024June    170

 

And, there is also total cost by date1 as below,

Date2Month Cost

February632
March83
April128
May181
June217

 

The matrix I want to reach out is as below.

 

                                          Date2Month        

Date1YearDate1MonthFebruaryMarchAprilMayJune
2024February-571-594-508-438-424
2024March -268113148
2024April  -372264
2024May   -82-4
2024June    -47

 

And the calculation of aim matrix;

1- Income- Cost for diagonal cells (Feb-Feb, March-March,...)

2- For next months the calculation should be aggregated sum.

 

Here is how the matrix should be calculated as,

 

                                           Date2Month        

Date1YearDate1MonthFebruaryMarchAprilMayJune
2024February"61-632=-571""-571-23""-594+86""-508+70""-438+13"
2024March "81-83""-2+70""68+45""113+35"
2024April  "91-128""-37+59""22+42"
2024May   "99-181""-82+78"
2024June    "170-217"

 

I can upload a sample pbix file if you need. Thank you for your helping.

 

Regards,

Veli

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This is one of the rare cases where a bidirectional relationship makes some sense.

 

lbendlin_0-1730204775851.png

 

I assumed your data is in a much better shape, like this

 

lbendlin_1-1730204823338.png

 

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

This is one of the rare cases where a bidirectional relationship makes some sense.

 

lbendlin_0-1730204775851.png

 

I assumed your data is in a much better shape, like this

 

lbendlin_1-1730204823338.png

 

 

Thank you @lbendlin , the measure works for me. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.