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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mattcarter865
Helper I
Helper I

Expand record column option not available even with foreign key defined in database

I am connecting to a PostgresQL database (DirectQuery). The table I am querying has multiple foreign keys defined however Power Query is not detecting any related tables for it. So I don't get the option to expand the record column. I've used this feature on other databases with foreign keys defined.

 

 

I confirmed that I have the "Include relationship columns" option checked. 

mattcarter865_0-1624981213595.png

 

 

I know I can work around it by adding the lookup tables then doing a merge, but it would be a lot more convienent to use the expand column feature. Just not sure if that feature is unsupported for Postgres or if there is some other option that I am overlooking.

 

7 REPLIES 7
v-yingjl
Community Support
Community Support

Hi @mattcarter865 ,

First make sure the foreign key works well in your databased.

When connecting to the database, to select related tables, not only enable 'Including related columns' in the connector page but also enable 'Select related tables' in the Navigation page.

1.png2.png3.png4.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I can confirm foreign keys are valid and work. I tried the "Select Related Tables" button and it did not work. It did not find any related tables. I'm guessing for the same reasons the expand record column option is not available in the first place. 

 

Also, I have used the expand record column option without using the "Select Related Tables" button in different database engines (e.g. Oracle).

 

Is your example using PostgresQL?

 

Thanks

Hi @mattcarter865 ,

Have re-created two sample tables in PostgreSQL DB again to test:

CategoryCategory_Category_Category

The foreign key between two tables is like:

3.png

When connect to each of these tables separately in power query, both of them can expanding columns without choosing 'select related tables':

11.png111.png

22.png222.png

 

When you connect to PostgreSQL, have you seen the expanding column in the Navigator page?

x.pngxx.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Must be something with this particular postgres database then? I don't see the same things you see in the Navigator dialog. 

Hi @mattcarter865 ,

I don't think so. As far as my test, only create two tables and the foreign key without any other steps in the database.

"Must be something with this particular postgres database then? I don't see the same things you see in the Navigator dialog. "

Perhaps the foreign key still does not work in the database.

 

What's the version of your power bi desktop and postgresql db, maybe you can try to update to the latest version to check it again.

 

My testing version:

Power BI Desktop: 2.94.921.0 (June 2021)

PostgreSql: 13.3 Windows x86-64

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I'm using PBI June 2021

Postgresql: 11.9 hosted on AWS (This is a company db, so I don't have control of the version)

 

I'm sure the foreign keys work. Using DBeaver, I can see the FKs and navigate them (i.e. click on a FK value and it opens the referenced table). Also, we would probably have production issues if they didn't.

Hi @mattcarter865 ,

Have tested again on PostgreSQL 11.9 in my side with the same steps and got the same result. Both of tables related by the foreign key can be expanded columns whether the connection mode is import or direct query.

p2.pngp3.pngp4.pngp5.pngp1.png

 

If this issue is urgent for you, I would suggest you to create a support ticket here for further support when having a Pro license.

Support Ticket.gif

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors