Forum Discussion
How to select related tables?
- Anonymous9 years ago
Yes, you have to create the relationships in the Power BI model even if corresponding relationships already exist in the source database. Power BI can automatically create relationships when you load two tables with matching key columns in a 1:M pattern, but I don't like to rely on that. Just manually set them up in the relationship manager.
Thank you, I understand this. But how exactly does Power BI identify Related Tables since in my attempt so far it has not recognized any related tables, regardless of which I base table I choose? I looked at your included URL and there is no details for how Power BI chooses these tables.
Hi ironryan77,
As stated in that blog, Power BI Desktop will automatically select all tables that have a direct relationship to one or more of the already selected tables.
In your scenario, tables should have been established relationships in the SQL Server database or Oracle database before you import data from them to Power BI, this way, once you select one table and then click "Select Related tables" option, Power BI Desktop will select all tables that have a direct relationship to the selected table.
Thanks,
Lydia Zhang
- ironryan779 years ago
Kudo Commander
That's the part I'm not sure I understand. Initially I thought that any tables which are sourced into stored procs on the same server, would become related. But are you saying that you have to manually create table relationships from the Database Diagrams folder? Is this the only way to create relationships?
- Anonymous9 years agoNot applicable
Yes, you have to create the relationships in the Power BI model even if corresponding relationships already exist in the source database. Power BI can automatically create relationships when you load two tables with matching key columns in a 1:M pattern, but I don't like to rely on that. Just manually set them up in the relationship manager.
- Anonymous7 years agoNot applicable
I dont understand how this feature is supposed to work. Let say I am starting a new BI project, I have all my data in SQL Server, with all the tables nicely organized with PK and FK.
If I select my fact table and click on the select related tables button, it does not find any. The answer above says that the relationship must already exist in PowerBI, but I am starting my project, getting the data is the first think I am suppoesd to do. Am I missing something?