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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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

@Anonymous strange.. 

Can you share your file?

Anonymous
Not applicable

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

@Anonymous 

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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