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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.