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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

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