Power Query Custom Column Question

jeancake

Board Regular
Joined
Nov 3, 2008
Messages
57
I have a file that contains transactions that are broken down into credits and debits. The issue I have is that the debits are not presented as negative numbers. I tried to create a custom column that stated if the transaction type = Debit than multiply it by -1 else keep the original amount, but it didn't work.

1) The custom column was formatted as text.
2) When I transform the column to decimal it still doesn't apply the formula.

I'm pretty new to Power Query and I figured that the approach I used would work.

What's the correct approach?

Thank You!
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
The approach sounds correct. The formula for the custom column should be like:

Code:
if [Type] = "Debit" then [Amount] * -1 else [Amount]

If it doesn't work in your case, then you need to provide more details for us to understand what is going wrong.
 
Upvote 0
I took a look at the raw data and saw that there were some errors that forced the data type to text which is why the formula didn't work. I fixed the error and it worked fine.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top