Forum Discussion
DAX Running Total based on Index
- 4 years ago
Hi Anonymous ,
Did you solve your problem, if yes, please mark it as a solution, if not, please try these codes below to do that.
My table looks like:
New column to calculate:
Column = SUMX ( FILTER ( 'Table', [SKU] = EARLIER ( 'Table'[SKU] ) && [SKU Index] <= EARLIER ( 'Table'[SKU Index] ) ), [+] - [-] )Result:
Measure:
Measure = SUMX ( FILTER ( ALLSELECTED ( 'Table' ), [SKU] = SELECTEDVALUE ( 'Table'[SKU] ) && [SKU Index] <= SELECTEDVALUE ( 'Table'[SKU Index] ) ), [+] - [-] )Result:
Best regards.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , I think you need sub category index
https://www.youtube.com/watch?v=7ypdbuCeBtk
https://www.youtube.com/watch?v=7CqXdSEN2k4
Hi! Yes, sorry I forgot to mention that, but it is the last column called SKU index.
I actually used the first video you suggested from Goodly to create it, and now with that sub category index, I think it is feasible to perform a running total based on that column.
- ChenwuZhu_Gmail4 years agoResolver I
Hi Anonymous ,
Did you solve your problem, if yes, please mark it as a solution, if not, please try these codes below to do that.
My table looks like:
New column to calculate:
Column = SUMX ( FILTER ( 'Table', [SKU] = EARLIER ( 'Table'[SKU] ) && [SKU Index] <= EARLIER ( 'Table'[SKU Index] ) ), [+] - [-] )Result:
Measure:
Measure = SUMX ( FILTER ( ALLSELECTED ( 'Table' ), [SKU] = SELECTEDVALUE ( 'Table'[SKU] ) && [SKU Index] <= SELECTEDVALUE ( 'Table'[SKU Index] ) ), [+] - [-] )Result:
Best regards.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous3 years agoNot applicable
This is indeed really helpful and works exactly as expected, thanks a lot