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