A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
To resolve the issue with creating a relationship between your two tables in Power BI, you need to adjust the relationship type based on the data characteristics of your tables.
Since Table 1 contains distinct Employee Codes with an Active/Inactive flag, and Table 2 contains multiple training records for each Employee Code, you should create a one-to-many relationship instead of a one-to-one relationship. In this case, Table 1 (the table with distinct Employee Codes) will be the "one" side, and Table 2 (the table with multiple training records) will be the "many" side.
Here’s how you can set up the relationship:
- Go to the Modeling tab in Power BI Desktop.
- Select Manage relationships and then click on New.
- In the Create relationship dialog, select Table 1 as the first table and the Employee Code column as the first column.
- Select Table 2 as the second table and the Employee Code column as the second column.
- Ensure that the relationship type is set to one-to-many (1:*).
- Click OK to create the relationship.
By doing this, you will allow Power BI to correctly relate the distinct Employee Codes in Table 1 to the multiple training records in Table 2, resolving the semantic model relationship issue.