Forum Discussion
Fraze
4 years agoHelper I
Using previous row in current row calculation
Hello, trying to create an outstanding column using data from the previous row. See example below for situation. ID #1 has no previous data, so the outstanding balance is the Net change of $1...
- 4 years ago
Fraze can you try this
Column = SUMX ( FILTER ( 'Table', 'Table'[Date] <= EARLIER ( 'Table'[Date] ) && 'Table'[Customer] = EARLIER ( 'Table'[Customer] ) ), 'Table'[Net Change] )
smpa01
4 years agoCommunity Champion
Fraze can you try this
Column = SUMX (
FILTER (
'Table',
'Table'[Date] <= EARLIER ( 'Table'[Date] )
&& 'Table'[Customer] = EARLIER ( 'Table'[Customer] )
),
'Table'[Net Change]
)
smpa01
4 years agoCommunity Champion
AlexisOlson on the above, I have noticed that. if the TransactionID is text, the running total goes sideways, if my partition is on ID
However, it behaves properly I change that back to integer.
I thought DAx stores the text values as per the CHAR value
- AlexisOlson4 years agoSuper User
I'm not sure what you mean by "stores the text values as per the CHAR value" but the problem is that "1", "10", and "3" are all <= "3" sorted alphabetically.
- smpa014 years agoCommunity Champion
AlexisOlson got it !!! many Thanks !!!!