title: One-to-many relationship always changed into many-to-one by PowerBI
body: <p>I have two tables from Azure SQL in PowerBI, using direct query: </p>
  
  <ul>
  <li><code>EMP(empID PK)</code></li>
  <li><code>contactInfo(contactID PK, empID FK, contactDetail)</code></li>
  </ul>
  
  <p>which have an obvious one-to-many relationship from <code>EMP.empID</code> to <code>contactInfo.empID</code>. The foreign key constraint is successfully enforced.</p>
  
  <p>However I can only create a many-to-one relationship (<code>contactInfo.empID</code> to <code>EMP.empID</code>) in PowerBI. If I ever try the opposite, PowerBI always automatically converts the relationship to many-to-one (by swapping the from and to column), which prevents me from creating visuals. Does PowerBI think the two are equivalent?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>What I'm doing is to just create a table in PowerBI showing the join results of these two tables. The foreign key constraint is <code>contactInfo.empID REFERENCES EMP.empID</code>, which is many-to-one. That should not be a problem, I guess, since I can directly query the join using SQL.</p>
  
  <p>Please also suggest if I should create the foreign key in the opposite direction.</p>
  
  <p><strong>More info on failure to create visual</strong></p>
  
  <p>The exact error message is: </p>
  
  <pre><code>Can't display the data because Power BI can't determine 
  the relationship between two or more fields.
  Version: 2.43.4647.541 (PBIDesktop)
  </code></pre>
  
  <p><strong><em>To reproduce the error:</em></strong></p>
  
  <p>DB schema is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/eRnoH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eRnoH.png" alt="schema"></a></p>
  
  <p>What I want is a table in PowerBI showing contact and sales info of am employee, that is, joining all the four tables. The error will occur when VALUES of the table visual contains "empName, contactDetail, contactType, productName", however, error will NOT occur if I only include "empName, contactDetail, contactType" or "empName, productName". At first I thought the problem may lie in the relationship between contactInfo and emp, but it now seems to be more complicated. I guess it may be caused by multiple one-to-many relationships?</p>