Forum Discussion
Relate same table twice
- 10 years ago
We cannot make two relationships active at the same time for two tables here. Using an inactive relationship is a way. This article should be a good reference.
Actually, we don’t need two relationships in some situations. As dejanle posted above, if we have two tables as below. We can create a relationship between Sell-to_Customer_No and Customer_No to get Sell-to Custome_Name.
We can also get Bill-to_Customer_Name by creating a column using LOOKUPVALUE without relationship.
Bill Customer Name = LOOKUPVALUE ( DB2[Customer_Name], DB2[Customer_No], DB1[Bill-to_Customer_No] )
Best Regards,
Herbert
Not sure how do you want to show their names. But I think you can create an active and an inactive relationship between two tables.
Please refer to this document.
Best Regards,
Herbert
Hello Herbert and many thanks for your reply
The problem with your solution is that i don't want to determine wich relation has priority above the other.
Tey are both important to me.
But i think i have to work it in other way. Don't know how since the table is design like this. Maybe duplicating a table....but that can be "dangerous".
Anyway. Tks a lot.
Brest regards
Pedro
- Anonymous10 years agoNot applicable
pedroccamara You providing a sample of what your issue is will go a long way in helping us determine a solution. Just throw down some sample data...
Does your scenerio look something like this?
DB1 DB2
Username Username Name
suser suser sample user
tuser tuser test user
- dejanle10 years agoNew Member
I have a similar problem and am looking forward to the answer. The example is as follows. We have a database of sales invoices in which you have two different customers: Sell-to Customer No. and Bill-to Customer No. (the first one is the customer who ordered goods, the second one will pay the invoice). Both Sell-to Customer No. and Bill-to Customer No. relate to the Customer List. So I would like to get Customer Name for both Sell-to Customer No. and Bill-to Customer No. In terms od databases, the situation is:
DB1:
Invoice_No
Sell-to_Customer_No
Bill-to_Customer_No
DB2:
Customer_No
Customer_Name
I want to be able to link DB1 to DB2 twice, to get both Sell-to Custome_Name and Bill-to_Customer_Name. Power BI, does not allow me to do both, either one or the other.
- Vvelarde10 years agoCommunity Champion
You can create 1 active and many inactive relationship.
After when i need to use a inactive relationship just put in dax USERELATIONSHIP(Table1[Colum], Table2[Column])
Hope this can help you
- pedroccamara10 years agoHelper II
yes. that's it