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
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
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
Hi Vvelarde
Thanks for your answer.
The problem is that i don't know where and how to use it. Everyday your database is growing and it's simple for me to refresh it and it's updated. I've miss the dax lesson also.
Best regards
Pedro
- v-haibl-msft10 years agoMicrosoft Employee
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