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
Aerobat
Frequent Visitor

Multiple relations between tables

Maybe an elementary question, but how do I create multiple relations betweens tables?

Example:

Person table has all persons, each person has Id.

Main table has several persons in one row, ex customer, salesagent etc. Each has Id in person table.

How do I create relations?

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Aerobat,

The current power bi data model table can create multiple relationships, but it only allows the one major relationship between different table records or they will cause the conflict of records analysis. (normally we will use star schema to build relationships)

Relationships in analysis services tabular models 

Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

In addition, you can also try to do unpivot column on these person fields to convert them to attribute a value.
Then you can simply build relationships on the value field and use the attribute field as filter to control which type of user will be filtered.

Unpivot columns (Power Query) (microsoft.com)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Aerobat
Frequent Visitor

Unfortunately I cannot take screenshot now. It have to wait until monday.

But I have one table with multiple fields referring to one field in "person" table. It is not possible to set up this way.

Generally, when you have a fact table with many id's (person, products, country) you can extract as new dimension tables, containing unique id's and then connect to your main fact table.

You can check this article:

https://radacad.com/creating-a-shared-dimension-in-power-bi-using-power-query-basics-and-foundations...

 

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




ALLUREAN
Solution Sage
Solution Sage

If understand correctly, you need to connect Person table to Main table based on Id? Can you share a screenshot of you data model?




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




goncalogeraldes
Super User
Super User

Hello there @Aerobat ! You can create such relationships in the model view in Power BI Desktop by just draging and droping the fields that make the relationship, like so:

goncalogeraldes_0-1642784540856.png

Or by using the "Manage Relationships" in the Home tab and selecting the "New..." option, like so:

goncalogeraldes_1-1642784580346.png

 

PS: this model is based in the NorthWind dataset provided by Microsoft

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

 

 

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.