Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rbowen
Helper III
Helper III

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

 

rbowen_0-1692051902639.png

 

 

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

There is the ABS function in dax: https://learn.microsoft.com/en-us/dax/abs-function-dax

but, you can always just use -1 * [amount], or even -[amount]

vicky__0-1692052855115.png

 

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

There is the ABS function in dax: https://learn.microsoft.com/en-us/dax/abs-function-dax

but, you can always just use -1 * [amount], or even -[amount]

vicky__0-1692052855115.png

 

Thank you Vicky, that worked. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.