cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JuergenB
Regular Visitor

Sum Values in a column row by row

Hello, 

 

I would appreciate the help of the community very much. 

I am searching for a solution to summarize the values of column Count, but the result in SUM should summarize only the values from the current row backwards. For illustration, please note the line with index number 6.

 

JuergenB_0-1651057368111.png

 

Thank you very much for taking time and a good day. 

 

1 ACCEPTED SOLUTION

Thank you for your quick feedback and your help.

I could implement your solution, but I have got this result. 

 

JuergenB_0-1651141351130.png

 

I have added the code like this:

 

JuergenB_1-1651141415541.png

Did I something wrong?

Thank you for your patience. 

View solution in original post

4 REPLIES 4
SpartaBI
Community Champion
Community Champion

@JuergenB strange.. 

Can you share your file?

Now it works. I have checked the Variable _curr_index and it was always empty. For this reason I have removed  the function SELECTEDVALUE. 

 

This are the results:

JuergenB_1-1651142415856.png

 

Here is the code:

JuergenB_0-1651142362309.png

 

Thank you a lot for your help. 

SpartaBI
Community Champion
Community Champion

@JuergenB 

SUM RT =
VAR _curr_index =
    SELECTEDVALUE ( Table[Index] )
RETURN
	CALCULATE(
		SUM(Table[Count],
		REMOVEFILTERS(Table),
		Table[Index] < = _curr_index
	)

Thank you for your quick feedback and your help.

I could implement your solution, but I have got this result. 

 

JuergenB_0-1651141351130.png

 

I have added the code like this:

 

JuergenB_1-1651141415541.png

Did I something wrong?

Thank you for your patience. 

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors