Forum Discussion
Anonymous
4 years agoNot applicable
DAX Running Total based on Index
Hello, I’m new to DAX and I’m trying to get a Running Total (Supply and Demand) based on the column SKU Index: What I’m trying to do is to replicate the next formula: =IF(N2=1, J2, I1+J2-K2) The ...
- 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.
ChenwuZhu_Gmail
4 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.
Anonymous
3 years agoNot applicable
This is indeed really helpful and works exactly as expected, thanks a lot