Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
HAL
Advocate I
Advocate I

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors