- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Establish Active relationship between multiple columns from two table
I have a data model as shown below where I have established relationship between two tables from two columns named orderid and itemid, but only orderid column is active
Can I establish active relationship for both the columns, any ways of doing it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.asp
If 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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Understood, @negi007 answers this question then. Another option is to join the tables together or create a unique table with the primary/foreign key relationship and link that to both of the related tables. PowerBI does not allow for multiple relationships between the same tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

any other ways other than using DAX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@sheetals you can have only one active relationship between two tables but you can use inactive relationship in your dax using
USERELATIONSHIP(<columnName1>,<columnName2>)
USERELATIONSHIP
USERELATIONSHIP(<columnName1>,<columnName2>)
Parameters
Term | Definition |
---|---|
columnName1 | The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the many side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression. |
columnName2 | The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the one side or lookup side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression. |
https://docs.microsoft.com/en-us/dax/userelationship-function-dax
Did I answer your question? Mark my post as a solution!
Appreciate your Kudos
Proud to be a Super User!
Follow me on linkedin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

any other ways other than using DAX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.asp
If 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.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
03-14-2024 09:46 PM | |||
Anonymous
| 09-20-2023 01:32 AM | ||
11-10-2023 06:59 AM | |||
09-12-2022 01:34 AM | |||
10-10-2023 05:05 AM |