Forum Discussion
NaturalLeftOuterJoin doesn't joint tables
- Anonymous3 years ago
Hi Anonymous ,
As far as I know, NATURALLEFTOUTERJOIN(LeftTable, RightTable) function will return a table which includes only rows from RightTable for which the values in the common columns specified are also present in LeftTable. The table returned will have the common columns from the left table and the other columns from both the tables.
So in your code, A and B tables have same columns, NATURALLEFTOUTERJOIN(A, B) will only return all columns from left table (A).
Here I create a sample to show you how to use this function.
NonHumanResourceUnitAssignments:
UserUnitAssignments:
UserUnitAssignmentsCombo = var A = SELECTCOLUMNS( UserUnitAssignments, "UnitId", UserUnitAssignments[UnitId]&"", "UserId", UserUnitAssignments[UserId]&"", "WorkingHoursPerWeek", UserUnitAssignments[WorkingHoursPerWeek]+0 ) var B = SELECTCOLUMNS( NonHumanResourceUnitAssignments, "UnitId", NonHumanResourceUnitAssignments[UnitId]&"", "UserId", NonHumanResourceUnitAssignments[UserId]&"", "Value", NonHumanResourceUnitAssignments[Value]+0 ) var result1= NATURALLEFTOUTERJOIN(A, B) return result1Result is as below.
For more details you may refer to this solved post.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
As far as I know, NATURALLEFTOUTERJOIN(LeftTable, RightTable) function will return a table which includes only rows from RightTable for which the values in the common columns specified are also present in LeftTable. The table returned will have the common columns from the left table and the other columns from both the tables.
So in your code, A and B tables have same columns, NATURALLEFTOUTERJOIN(A, B) will only return all columns from left table (A).
Here I create a sample to show you how to use this function.
NonHumanResourceUnitAssignments:
UserUnitAssignments:
UserUnitAssignmentsCombo =
var A =
SELECTCOLUMNS(
UserUnitAssignments,
"UnitId", UserUnitAssignments[UnitId]&"",
"UserId", UserUnitAssignments[UserId]&"",
"WorkingHoursPerWeek", UserUnitAssignments[WorkingHoursPerWeek]+0
)
var B =
SELECTCOLUMNS(
NonHumanResourceUnitAssignments,
"UnitId", NonHumanResourceUnitAssignments[UnitId]&"",
"UserId", NonHumanResourceUnitAssignments[UserId]&"",
"Value", NonHumanResourceUnitAssignments[Value]+0
)
var result1= NATURALLEFTOUTERJOIN(A, B)
return
result1
Result is as below.
For more details you may refer to this solved post.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Oh, thank you for explanation.
Which function will join bouth tables? It means that new table will contain all values and columns from both tables. And columns with identical name will be merged to one. Input tables have no relationship.
- Anonymous3 years agoNot applicable
I found one, it is function Union. For more datail see https://radacad.com/combining-tables-in-power-bi-union-except-and-intersect-in-dax