Create a relationship
Applies to: SQL Server Analysis Services Azure Analysis Services Fabric/Power BI Premium
If the tables in your data source do not have existing relationships, or if you add new tables, you can use the tools in the model designer to create new relationships. For information about how relationships are used in tabular models, see Relationships.
Create a relationship between two tables
To create a relationship between two tables in Diagram View (Click and drag)
In SQL Server Data Tools, click the Model menu, then click Model View, and then click Diagram View.
Click (and hold) on a column within a table, then drag the cursor to a related lookup column in a related lookup table, and then release. The relationship will be created in the correct order automatically.
To create a relationship between two tables in Diagram View (Right-click)
In SQL Server Data Tools, click the Model menu, then click Model View, and then click Diagram View.
Right-click a table heading or column, and then click Create Relationship.
In the Create Relationship dialog box, click the down arrow for Table, and select a table from the dropdown list.
In a "one-to-many" relationship, this table should be on the "many" side.
For Column, select the column that contains the data that is related to Related Lookup Column. The column is automatically selected if you right-clicked on a column to create the relationship.
For Related Lookup Table, select a table that has at least one column of data that is related to the table you just selected for Table.
In a "one-to-many" relationship, this table should be on the "one" side, meaning that the values in the selected column do not contain duplicates. If you attempt to create the relationship in the wrong order (one-to-many instead of many-to-one), an icon will appear next to the Related Lookup Column field. Reverse the order to create a valid relationship.
For Related Lookup Column, select a column that has unique values that match the values in the column you selected for Column.
Click Create.
To create a relationship between two tables in Data View
In SQL Server Data Tools, click the Table menu, and then click Create Relationships.
In the Create Relationship dialog box, click the down arrow for Table, and select a table from the dropdown list.
In a "one-to-many" relationship, this table should be on the "many" side.
For Column, select the column that contains the data that is related to Related Lookup Column.
For Related Lookup Table, select a table that has at least one column of data that is related to the table you just selected for Table.
In a "one-to-many" relationship, this table should be on the "one" side, meaning that the values in the selected column do not contain duplicates. If you attempt to create the relationship in the wrong order (one-to-many instead of many-to-one), an icon will appear next to the Related Lookup Column field. Reverse the order to create a valid relationship.
For Related Lookup Column, select a column that has unique values that match the values in the column you selected for Column.
Click Create.