Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
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]
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]
Thank you Vicky, that worked.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
98 | |
79 | |
75 | |
66 |
User | Count |
---|---|
136 | |
109 | |
104 | |
82 | |
73 |