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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jeroenbenda
Frequent Visitor

Define relationships in MySQL source

I am working on getting a MySQL source available to a lot of managers to be used in Power BI. I have everything working nicely but I would really like is to be able to predefine all relationships so that when the user adds the database and some or all of the tables, the needed relationships are already defined. Currently the unique id for every table is called id and reference to another table will be something like billid. Is it possible for me to add data somehow on the source that if people load the data source in BI that all relationships are defined. Maybe in a specific table or something. I understand that I could probably rename the fields id to billid or whatever but that means changing a lot of original code and websites. It's an already existing data source that I want to publish for them.

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @jeroenbenda,

Currently the unique id for every table is called id and reference to another table will be something like billid. Is it possible for me to add data somehow on the source that if people load the data source in BI that all relationships are defined.

Based on my test, when importing data from MySQL database on Power BI Desktop, if we have "Include Relationship columns" option checked like below, and make sure the tables are related by Foreign Keys(id and billid)  in MySQL databases, all the relationships will remain among the imported tables on Power BI Desktop.Smiley Happy

 

relationshipc.PNG

 

Regards

Thank you. That does work indeed. Only thing left is preventing all tables to be linked because the all share the same key, namely id as the unique key. Is there any way to do that?

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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