Add Column with subtraction formula [Power Query 2013)

kachaloo

New Member
Joined
Jan 18, 2011
Messages
22
Office Version
  1. 2016
Platform
  1. Windows
Hello all
I am very new to Power Query and still learning. I have figured that my Excel formulas are not working here :)

I would like to add a column to a query from table columns Cr and Dr. I want to get result in New column "Subtraction" as Cr-Dr..
i.e -5939.91, 1900 and so on.

Any tips please.

Thank you
 

Attachments

  • Capture.JPG
    Capture.JPG
    48.3 KB · Views: 280

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
try
Code:
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type",null,0,Replacer.ReplaceValue,{"Dr", "Cr"}),
    #"Inserted Subtraction" = Table.AddColumn(#"Replaced Value", "Subtraction", each [Cr] - [Dr], Int64.Type)
 
Upvote 0
Good morning @sandy666
I have copied and pasted it custom column. get error Token Eof expected it highlights ","
Not working for me I guess I don't know how to use it :)
If I remove the subtraction column and add custom column. how this formula will be modified.
Thanks
 
Upvote 0
select Cr and Dr then replace null to 0
repl.png


then select Cr and Dr (the order of selection matters) then
subt.png
 
Upvote 0

Forum statistics

Threads
1,223,799
Messages
6,174,669
Members
452,576
Latest member
AlexG_UK

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