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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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