cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Deepan Frequent Visitor
Frequent 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

Accepted Solutions
Ross73312 Super Contributor
Super Contributor

Re: Calculate cumulative sum for decimal numbers

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])
)

   

              Did I answer your question? Mark my post as a solution!
       

Proud to be a Datanaut!


   


View solution in original post

2 REPLIES 2
Ross73312 Super Contributor
Super Contributor

Re: Calculate cumulative sum for decimal numbers

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])
)

   

              Did I answer your question? Mark my post as a solution!
       

Proud to be a Datanaut!


   


View solution in original post

Moderator v-caliao-msft
Moderator

Re: Calculate cumulative sum for decimal numbers

@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

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,540)