cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HAL
Regular Visitor

Promote Autodetect Relationships

Hello Power BI Community:

When designing my database schema, I would like to name the columns so that Power BI's "autodetect" feature for relationships works perfectly and unambiguously. I could not find many meaningful hints in the documentation so far.

I am glad for any suggestions or information how the algorithm works.

Thanks,

Hal.

1 REPLY 1
ankitpatira
Community Champion
Community Champion

@HAL I have dealt with these scenario a lot. In my experience powerbi desktop when loading data will use column names to determine if there is a relationship between two tables. For exampel you have customerID column in one table and customerID in another it will be related. However it will also look at the data so essentially determining PK FK principles. 

 

Through lot of testing I've found a solution that has been working for me so far. Even though if you design your database properly and have all necessary PK FK relations powerbi desktop hasn't always automatically created them all. In my case I had a lot PK FK relations in database that had more than 30 tables. To avoid any manual work and manually creating relationships in powerbi desktop, I have initially used DirectQuery feature to connect to my database (I had sql server db and so DirectQuery is supported). With DirectQuery no data is imported in powerbi desktop and it maintains all PK FK relations you have in your database. Once connected save your pbix file (without doing any further work on visuals).  

 

Next time you open that pbix file you will have button on bottom left hand corner saying DirectQuery enabled click here to change. Using that change it to import. This will load data from your tables into powerbi desktop but will maintain all PK FK relations and so you've avoided any missing out of relations that would had to be done manually.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

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!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors