Forum Discussion
Running total based on multiple column
- 3 years ago
Anonymous So you will never had a Value that is less than a "previous" row? If that is the case then you could do this:
Measure = VAR __Value = MAX('Table'[Value]) VAR __Table = FILTER(ALLSELECTED('Table'),[Value] <= __Value) RETURN SUMX(__Table,[Value])
Anonymous You are going to need an Index or Date column to allow you to define "before".
- Greg_Deckler3 years agoCommunity Champion
Anonymous So you will never had a Value that is less than a "previous" row? If that is the case then you could do this:
Measure = VAR __Value = MAX('Table'[Value]) VAR __Table = FILTER(ALLSELECTED('Table'),[Value] <= __Value) RETURN SUMX(__Table,[Value])- Anonymous3 years agoNot applicable
Thank you so much Greg_Deckler for your support.
Logic is woking fine but, if previous row value currerent row value same then it is getting wrong running total number.
There is chanse previous row value currerent row value same
Please help me on this 🙂
- Greg_Deckler3 years agoCommunity Champion
Anonymous
And, hence, why you need an Index or Date column. No way to solve it if values can be equal or a subsequent value is less than the current value. Just add an Index column in Power Query. Otherwise, you are stuck with a DAX index:
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528