Forum Discussion
Fraze
Helper I
4 years agoUsing 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
Community Champion
4 years agoFraze can you try this
Column = SUMX (
FILTER (
'Table',
'Table'[Date] <= EARLIER ( 'Table'[Date] )
&& 'Table'[Customer] = EARLIER ( 'Table'[Customer] )
),
'Table'[Net Change]
)
smpa01
Community Champion
4 years agoAlexisOlson 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 ago
Super 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 ago
Community Champion
AlexisOlson got it !!! many Thanks !!!!