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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Outer join not showing expected results

Hi,

 

I would like to create a join that looks like this:

Table A Table B   Expected Result 
         
Period VesselPeriodValue VesselPeriodValue
01-Jan-19 Vessel A01-Oct-191 Vessel A01-Jan-19 
01-Feb-19 Vessel A01-Nov-192 Vessel A01-Feb-19 
01-Mar-19 Vessel A01-Dec-193 Vessel A01-Mar-19 
01-Apr-19 Vessel A01-Jan-204 Vessel A01-Apr-19 
01-May-19 Vessel A01-Feb-205 Vessel A01-May-19 
01-Jun-19 Vessel A01-Mar-206 Vessel A01-Jun-19 
01-Jul-19 Vessel A01-Apr-207 Vessel A01-Jul-19 
01-Aug-19 Vessel A01-May-208 Vessel A01-Aug-19 
01-Sep-19 Vessel A01-Jun-209 Vessel A01-Sep-19 
01-Oct-19 Vessel A01-Jul-200 Vessel A01-Oct-191
01-Nov-19 Vessel A01-Aug-201 Vessel A01-Nov-192
01-Dec-19     Vessel A01-Dec-193
01-Jan-20     Vessel A01-Jan-204
01-Feb-20     Vessel A01-Feb-205
01-Mar-20     Vessel A01-Mar-206
01-Apr-20     Vessel A01-Apr-207
01-May-20     Vessel A01-May-208
01-Jun-20     Vessel A01-Jun-209
01-Jul-20     Vessel A01-Jul-200
01-Aug-20     Vessel A01-Aug-201
01-Sep-20     Vessel A01-Sep-20 
01-Oct-20     Vessel A01-Oct-20 
01-Nov-20     Vessel A01-Nov-20 
01-Dec-20     Vessel A01-Dec-20 

 

I did a full outer join on Period (Table A) = Period (Table B). However, my result is always showing the same as Table B, and not what I expected on the last table. Anyone know if I am doing this the right way? Please advise. Thanks!

1 ACCEPTED SOLUTION

Hi @Anonymous 

You can take your Vessel table like below.

 

image.png

 

Add to your period table like below.

image.png

then just expand vessels in into rows and merge wit table b

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

7 REPLIES 7
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You probably need to have an extra table with Vessels and add it to your period table as an extra column, later you will need to merge on Date and Vessel to get your result.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

HotChilli
Super User
Super User

Left outer join won't bring the "Vessel A" text into every row.

If you add a column to Table A before the join:

="Vessel A"

That should do it.

 

I suspect the real data is a bit more complex

Anonymous
Not applicable

Hi,

 

Thanks for your reply. I am trying to do a full outer join here in fact.

 

And you are right, the real data is much more complex, with several vessels and each have different period. I need all of the vessels to conform to the same period as Table A. I expect to see blank values for rows that do not yet exist in Table B

Hi @Anonymous ,

 

Please try below the M code:

let
    Source = Table.NestedJoin(TableA, {"Period"}, TableB, {"Period"}, "TableB", JoinKind.LeftOuter),
    #"Expanded TableB" = Table.ExpandTableColumn(Source, "TableB", {"Vessel", "Period", "Value"}, {"TableB.Vessel", "TableB.Period", "TableB.Value"}),
    #"Sorted Rows" = Table.Sort(#"Expanded TableB",{{"Period", Order.Ascending}}),
    #"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"TableB.Vessel", "TableB.Period"})
in
    #"Removed Columns"
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Hi @Anonymous 

You can take your Vessel table like below.

 

image.png

 

Add to your period table like below.

image.png

then just expand vessels in into rows and merge wit table b

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Anonymous
Not applicable

Thanks Mariusz! This solution works for me. Adding column from a table instead of merging is something new to me, and that works well. Thanks for sharing and I've learnt something new and valuable!

Hi @Anonymous 

Happy I could help.

 

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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