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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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