Regarding the binding of tables in Power BI, I would like to know how to make this connection, in the habitiude in SQL, we do the join or the connection between the tables with a primary key, but in Power BI I noted that There are linked tables with other fields.
For example in this screenshot, I would like to join these two tables Stock and orders, Can we join them with the fields date or Year, or month or company since they exist in the two tables? And what is the difference between joining with a primary key and joining with a normal field?
I thank you in advance.
Hi @Anonymous ,
In fact, you not need to join fields to another table.
After you finished to create relationships, you can direct to use table fields to create chart/visuals.(power bi will analyze summarize these fields based on current relationship and group fields)
BTW, after you build relationship between tables, you can add a calculated column with related function to simply invoke related field from related table.
JOIN and RELATIONSHIP work on similar fundamentals, i.e. there should be one common field between the two tables. However, the major difference between them is that by using JOIN you are compiling all the data into one table and then creating your reports/data model; however, using RELATIONSHIPS you can achieve the same results by linking the two tables.
In your case, you can first create a relationship between stock and order table and then proceed with creating visuals or tables.
And I do not think that there is any difference between joining with a primary key and joining with a normal field. As long as you can create a unique combination for the query to map the required field, the result should not be any different.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!