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
Deepan
Regular Visitor

Calculate cumulative sum for decimal numbers

I have a table with set of integer IDs and another column called improvement which is a decimal column. I am trying to create a table visual which shows ID, Improvement and the Cumulative Improvement which is the total of previous and current improvement values. To make it clear I have an image below.  

 

Capture.PNG

Cumulative Improvement is the  column I want to show in my table visual. As you can see in the image it is the sum of the improvement of the current record and the cumalative improvement of the previous record. 

 

I created a measure to achive this.

Capture2.PNG

 

But what I get is the same value as Improvement column. What am I doing wrong here?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Very close.  First thing, you need to do this as a column rather than a measure.  Then you can use this code:

 

Cumulative Improvement = CALCULATE(
	SUM(Sheet1[Improvement]),
	all(Sheet1),
	Sheet1[ID] <= EARLIER(Sheet1[ID])
)

View solution in original post

2 REPLIES 2
v-caliao-msft
Employee
Employee

@Deepan,

 

It seems your formula is correct. I can use this DAX expression to get expected result.

Capture.PNG

In your scenario, could you please share your PBIX file, so that we can make further analysis.

 

Regards,

Charlie Liao

Anonymous
Not applicable

Very close.  First thing, you need to do this as a column rather than a measure.  Then you can use this code:

 

Cumulative Improvement = CALCULATE(
	SUM(Sheet1[Improvement]),
	all(Sheet1),
	Sheet1[ID] <= EARLIER(Sheet1[ID])
)

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.