Forum Discussion

rbowen's avatar
rbowen
Helper III
3 years ago
Solved

Flip Number To Negative Based On A Different Column

Howdy All - 

 

I'd like to create a calculated column that flips a number to it's negative value based on a second column's designation of debit or credit.  The table below is the one I'm trying to do this in - it's being pulled in from one of our DB's so can't flip the sign in the DB unfortunately. I'd like the DAX to first look at the debcred column, if the value is 'D', then take the value in the amount column and put it into the calculated column but with a negative sign. If the value is a 'C', just copy the value into the calculated column without changing its sign. There's a way to do this in Excel with a -ABS function but, from what I can tell, the DAX version of that function doesn't support that (or does it??).  Is there a DAX statement that will accomplish what I'm after?

 

Thank you