Forum Discussion
Establish Active relationship between multiple columns from two table
- Anonymous4 years ago
You can join the tables in the Query, depending on the context of your data you would need to pick the appropriate join (Left, Inner, Full Outer). These are basic SQL join parameters. Website for details here:
https://www.w3schools.com/sql/sql_join.aspIf you want to create this relationship you have 3 options:
1) Joins [Left, Inner, Full Outer] in Power Query
2) Summary tables to make distinct keys for relationships to tables
3) DAX - USERELATIONSHIP function that was mentioned above.
Hi! For context, why does there need to be a relationship from:
ItemID [Order_Items] to ItemID [Orders]
OrderID [Order_Items] to OrderID [Orders] ?
All you need is a single relationship to connect the tables, however, a better way to structure this may be either creating 2 s_tables (each with a distinct primary key of OrderID and ItemID) or if there is a primary/foreign key relationship you can make one s_table of primarykey,foreignkey.
Distinct List of Order ID:
Union OrderID from both tables, take distinct. This can be done in query or DAX.
Anonymous orderid and itemid are just examples i have given, i just need to know whether realtionship can be established from multiple columns that acts like AND operator