Forum Discussion
Change The Sign Of A Number in One Column Based On The Value In Another Column
I have a collection of account numbers in one column, Main Account Number, and a transaction amount for them in another column - Transaction Amount. I'd like to create a calculated column where, if the Main Account Number begins with the number 4, then change the sign of the number from negative to positive. Otherwise, leave the Transaction Amount alone and include it in the new column. Tried various ways to accomplish this but am missing some kind of crucial syntax bit that would make it work fully. As there's no "LIKE" dax function as in SQL, I'm not clear on what to use. Any ideas?
Thank you
Hello rbowen ,
use the following calculated column
Column = IF(VALUE(LEFT('Table'[Column2], 1)) = 4, ABS('Table'[Column1]), 'Table'[Column1])
2 Replies
- Idrissshatila
Super User
Hello rbowen ,
use the following calculated column
Column = IF(VALUE(LEFT('Table'[Column2], 1)) = 4, ABS('Table'[Column1]), 'Table'[Column1])- rbowen
Helper III
Thank you, Idriss, that worked perfectly.