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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
yevhen_87
Frequent Visitor

Merging steps in Power Query

Is it possible to merge group by step with a previous step which is original table?

2 ACCEPTED SOLUTIONS
watkinnc
Super User
Super User

Yes it is possible. All you need to do is refer to the previous step as your table name, and a column that exists in the source table as your matching column. So

 

ThisStep = Table.NestedJoin(GroupingStep, {"ColumnName"}, Source, {"OtherColumnName"}, "JoinColumnName", JoinKind.LeftOuter)

 

You can use any step in your query that returns a table, as a parameter in a table function, and there are lots of good reasons to do it.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

Omid_Motamedise
Memorable Member
Memorable Member

Yes, it is possible, conside the next example

 

Omid_Motamedise_0-1730847651095.png

use the merge with the setting provided in the nex image (use the same table in left and right part)

 

Omid_Motamedise_1-1730847705893.png

 

this is resulting the following formula

 

= Table.NestedJoin(#"Added Custom", {"Date"}, #"Added Custom", {"Date"}, "Added Custom", JoinKind.LeftOuter)

 

replace #"Added Custom" with name of previous step (Index) and  if theire column name is different,  replace date in  {"Date"} with the name of the column in the Index step you want to use for merging.

View solution in original post

3 REPLIES 3
Omid_Motamedise
Memorable Member
Memorable Member

Yes, it is possible, conside the next example

 

Omid_Motamedise_0-1730847651095.png

use the merge with the setting provided in the nex image (use the same table in left and right part)

 

Omid_Motamedise_1-1730847705893.png

 

this is resulting the following formula

 

= Table.NestedJoin(#"Added Custom", {"Date"}, #"Added Custom", {"Date"}, "Added Custom", JoinKind.LeftOuter)

 

replace #"Added Custom" with name of previous step (Index) and  if theire column name is different,  replace date in  {"Date"} with the name of the column in the Index step you want to use for merging.

watkinnc
Super User
Super User

Yes it is possible. All you need to do is refer to the previous step as your table name, and a column that exists in the source table as your matching column. So

 

ThisStep = Table.NestedJoin(GroupingStep, {"ColumnName"}, Source, {"OtherColumnName"}, "JoinColumnName", JoinKind.LeftOuter)

 

You can use any step in your query that returns a table, as a parameter in a table function, and there are lots of good reasons to do it.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
uzuntasgokberk
Solution Sage
Solution Sage

Hello @yevhen_87 ,

 

İt is not possible in the same 1 query. But Yes, it is possible but in your Power Query you need 2 different query. You can duplicate your original query or reference(on previous step group by). Your second query needs to be added group by step and then merge 2 table.

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.