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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

powerbi tries to get primary keys from nested tables

When we import a table with Power BI, we are getting "nested tables" as columns which are for any referential integrity foreign keys.  That is to say that they keys are from other tables which reference the one we query.


When that happens, Power BI then tries to get Primary Keys and other structure information from those related tables.  And it does this without us asking it to.  A "feature", I'm sure.


However, not all of those tables are accessible by the powerbi gateway service account, and should not be.
So the call for DDL information fails, and we get the error while refreshing the data set.

 

Does anyone know how to turn that behavior off in Power BI?

 

The workarounds I can come up with are not so great:  (1) grant access to objects and hope nobody notices;  (2) break (remove) the foreign key definitions and hope other projects aren't impacted; (3) create entirely new objects that are identical to the original without any such key relationships ... and hope everyone remembers to use those for Power BI instead of the objects used by all other programs.

1 REPLY 1
trebgatte
Most Valuable Professional
Most Valuable Professional

This should prevent this from happening.

 

In Desktop

  1. Go to File, Options and Settings, Options
  2. Under Current File, click Data Load
  3. Uncheck Import relationships from data sources on first load

I hope this helps!

--Treb

 

Check out my Power BI blog posts at: https://marqueeinsights.com/blog 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors