We have a table showing data like OpprId, revenue, area region where table is sorted based on highest revenue. This table was built using power query. Here user wants to add
Edit 29/11/2016: a video is now available to clarify this solution. The code is a little bit different from the code below; basically it's still the same solution.
On another forum I answered a similar question. First the input data (first name and last name) was read and output by a Power Query query. A column was added to that output (Age - manually maintained). Now I created a query that reads data from the Input table, left joins it with the Output table and write the results back to the Output table. So the Output table is both input and output from that query.
let
Source1 = Excel.CurrentWorkbook(){[Name="Input"]}[Content],
Typed1 = Table.TransformColumnTypes(Source1,{{"Last Name", type text}, {"First Name", type text}}),
Source2 = Excel.CurrentWorkbook(){[Name="Output"]}[Content],
Typed2 = Table.TransformColumnTypes(Source2,{{"Last Name", type text}, {"First Name", type text}, {"Age" , type number}}),
Renamed2 = Table.RenameColumns(Typed2,{{"Last Name", "Last"}, {"First Name", "First"}}),
Join1and2 = Table.Join(Typed1,{"Last Name", "First Name"},Renamed2,{"Last", "First"}, JoinKind.LeftOuter),
Removed = Table.RemoveColumns(Join1and2,{"Last", "First"})
in
Removed