Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I have 2 data sources and in both of them thare are columns NAME and ID. I would like to do a conditional join such as:
If NAME and ID are equal in both data sources join it based on these 2 columns; if not join it only based on NAME column.
If anybody can provide code from advance editor I would be very greatful.
Thanks
Solved! Go to Solution.
@Anonymous
Try following code.
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Id", "Name"}, Table2, {"ID", "Name"}, "Table2", JoinKind.LeftOuter),
#"Merged Queries1" = Table.NestedJoin(#"Merged Queries", {"Name"}, Table2, {"Name"}, "Table2.1", JoinKind.LeftOuter),
#"Added Custom" = Table.AddColumn(#"Merged Queries1", "Custom", each if Table.RowCount([Table2]) > 0 then [Table2] else [Table2.1])
in
#"Added Custom"
@Anonymous
Try following code.
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Id", "Name"}, Table2, {"ID", "Name"}, "Table2", JoinKind.LeftOuter),
#"Merged Queries1" = Table.NestedJoin(#"Merged Queries", {"Name"}, Table2, {"Name"}, "Table2.1", JoinKind.LeftOuter),
#"Added Custom" = Table.AddColumn(#"Merged Queries1", "Custom", each if Table.RowCount([Table2]) > 0 then [Table2] else [Table2.1])
in
#"Added Custom"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
65 | |
45 | |
39 | |
31 |
User | Count |
---|---|
164 | |
111 | |
61 | |
53 | |
38 |