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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
corrado69
New Member

cumulative sum

this is a simplified version of my project:

- una table with a column date and a colum A:

DateA
01-gen1
01-feb2
01-mar3
01-apr4
01-mag5
01-giu6
01-lug7
01-ago8
01-set9
01-ott10
01-nov11
01-dic12

 

- una table with a column date and a colum B (with empty values in some rows):

DateB
01-gen1
01-feb2
01-mar3
01-apr 
01-mag 
01-giu 
01-lug 
01-ago 
01-set 
01-ott 
01-nov 
01-dic 

 

- a table with dates (I created a link with the date column of the other 2 tables):

Data
01-gen
01-feb
01-mar
01-apr
01-mag
01-giu
01-lug
01-ago
01-set
01-ott
01-nov
01-dic

 

I would like to create a measure that is the cumulative sum of A+B for each month:

DataABA+Bcumul A+B
01-gen1122
01-feb2246
01-mar33612
01-apr4 416
01-mag5 521
01-giu6 627
01-lug7 734
01-ago8 842
01-set9 951
01-ott10 1061
01-nov11 1172
01-dic12 1284

 

I'm able to calculate the cumulative sum if there are values in all rows of A and B but not if there are some empty values in one of the 2 columns A or B. In this case my formula gives a correct value from Jan to March but then gives values equal to A (if B is the column with empty values) from April to December.

 

1 ACCEPTED SOLUTION
govindarajan_d
Super User
Super User

Hi @corrado69 ,

 

Can you try the following formula?

CumulativeSum = 
CALCULATE([SumOfAandB],FILTER(ALL(Date), DateTable[Date] <= MAX(DateTable[Date]))

View solution in original post

1 REPLY 1
govindarajan_d
Super User
Super User

Hi @corrado69 ,

 

Can you try the following formula?

CumulativeSum = 
CALCULATE([SumOfAandB],FILTER(ALL(Date), DateTable[Date] <= MAX(DateTable[Date]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.