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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors