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.
Hi ironryan77,
The “Select Related Tables” option is useful when users want to import multiple tables when connecting to a database. Without this option, users have to manually select all tables that they wanted to import, which often required an understanding of the underlying database schema so they would pick all tables that are related.
With this option, Power BI Desktop will automatically select all tables that have a direct relationship to one or more of the already selected tables.
Reference:
https://powerbi.microsoft.com/fr-fr/blog/44-new-features-in-the-power-bi-desktop-september-update/
Thanks,
Lydia Zhang
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.
- Anonymous9 years agoNot applicable
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.