Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

PowerQuery: InterQuery Merge

I often have to merge one step of a query with another step from the same query. It would be usefull if I could select existing steps of current query from interface. 

 

The situation comes up often when, for example, you have a general mapping that needs to be filtered before applied. Or merging two tables that need to be groupped before merge. I don't want to create separate query just for filtering \ merge, so I do it inside the main query. Example:

let
Source1 = Table1
GroupedforMerge = Table.Group(Source1 , {"SettleDate", "NonResID", "SubAccCode", "SECID", "SecISIN", "SecName", "SecAssetClass","SettlCur"}, {{"SettleAmount", each List.Sum([SettleAmount]), type number}}),
Source2 = Table2,
//2nd table
FilteredCode141C = Table.SelectRows(Source2, each ([КодДоходаКод] = "14")),
#"Merged Queries" = Table.NestedJoin(FilteredCode141C, {"КонтрагентКод", "Валюта", "ДатаВыплатыДохода", "ДоговорСКлиентом", "КодЦБ"}, GroupedforMerge, {"NonResID","SettlCur","SettleDate","SubAccCode","SECID"}, "FilteredCode14QORT", JoinKind.FullOuter),
....

It would be nice to be able to select "GroupedforMerge" step from inrface and not manually write it in code.

Status: New
Comments
v-yuta-msft
Community Support

@Anonymous ,

 

Actually if you want to merge tables in power query, you don't need to input code manually, there's in interface button, you can select Merge queries as below:

2.PNG  

 

Regards,

Jimmy Tao

 

 

Anonymous
Not applicable

@v-yuta-msft 

 

Jimmy, thank you for your comment. I know about this feature, but it wouldn't let me merge a query to another step in the same query, which is sometimes nescessary.

 

For example, I have a query thar references two outside queries - "IFRS" & "New report". However before megring I want to make some amendments to initial queries - filtering & grouping. So in fact I want to merge the "GroupedNewReport" step with "GroupedIFRS" step. And the intrface wouldn't allow me to choose "GroupedIFRS" as an option.

 

2020.06.22_InterstepMerge.JPG