Forum Discussion
KerwenZhang
7 years agoFrequent Visitor
Sum from first line to current line
I have one column named "Result", 1 means success, 0 means fail. How should I calculate the total success count from frist line to current line? The final result should be like following: Result To...
- 7 years ago
Running Total COLUMN = CALCULATE ( SUM ( 'Sheet1'[Values] ), ALL ( 'Sheet1' ), 'Sheet1'[ID] <= EARLIER ( 'Sheet1'[ID] ) )Lets say ID is the name of your first column and values is the second column
- 7 years ago
KerwenZhang Please add an Index column in "Power Query Editor" and then use the below logic in Data pane as New Column
Total = CALCULATE(SUM(Test158CummSum[Result]),FILTER(Test158CummSum,Test158CummSum[Index]<=EARLIER(Test158CummSum[Index])))
PattemManohar
Community Champion
7 years agoKerwenZhang Please add an Index column in "Power Query Editor" and then use the below logic in Data pane as New Column
Total = CALCULATE(SUM(Test158CummSum[Result]),FILTER(Test158CummSum,Test158CummSum[Index]<=EARLIER(Test158CummSum[Index])))