Forum Discussion

ironryan77's avatar
ironryan77
Icon for Kudo Commander rankKudo Commander
9 years ago
Solved

How to select related tables?

Does this functionality work?  I have tried using Select Related Tables when getting data from SQL Server and OLE DB, but each time I select this option, it says:

We didn't find any more related tables.

Am I doing something wrong?

 

  • Anonymous's avatar
    Anonymous
    9 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.

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

    • ironryan77's avatar
      ironryan77
      Icon for Kudo Commander rankKudo Commander

      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.

      • Anonymous's avatar
        Anonymous
        Not 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

  • Yes RelatedTable function works for me.

    Obivously, you need a relationship between your 2 tables.

    RelatedTable goes from the One side to the Many side.

     

    What is not working for you ?

    • ironryan77's avatar
      ironryan77
      Icon for Kudo Commander rankKudo Commander

      Oh, so it sounds like I need to define relationships before I can select related tables?  I don't have any relationships defined in Power BI yet for these tables.  But many other tables are sourced from this one SQL table that I chose "Select Related Tables" on.  If I need to define relationships first, then what is the benefit of this feature?