Forum Discussion
Relationship
Hi there, Is there any article/ video or any explationaion from you about relationship?
I always struggle with making relationship.
I never get clear vision of
1) what is the condition to make one to one/ many to one and sigle or both direction
2) and what effect i can get from different condition?
please be simple and easy for me 🙂
4 Replies
- Pragati11Super User
Hi Anonymous ,
There are few main points for relationships in Power BI:
- Relationships allow you to use data from mutiple tables for reporting, rather than having a single big table.
- Relationship help in cross-filtering data among the tables where this is created.
- In order to create a relationship, you should have a common column in both the tables.
- Cardinality of a relationship can be one-one, one-many, many-one or many-many.
- Many-many cardinality is generally avoided as it creates ambiguity in the data.
There are few articles on Power BI relationship which you can start with to understand them in detail:
https://radacad.com/what-is-the-direction-of-relationship-in-power-bi
Start with these, I am sure you will understand what these are and how they are created.
Thanks,
Pragati
- AllisonKennedyCommunity ChampionAnonymous
Great question, I have been meaning to write a blog post on this topic for a while. I'm sure you've seen a few articles and videos out there from a google search.
Basically, your main data table is your FACT or transaction table - this has one row for each transaction (a transaction could be a sale, incident, complaint, registration, etc).
Let's use incident reporting as an example, since it differs a bit from the typical sales examples already posted on the internet and I'm not sure what your normal scenario is.
So if you are reporting on incidents that have been reported over the past month, you might see a table with columns such as:
* IncidentID
* IncidentDate
* EmployeeID
* TransactionID
From that small amount of information, I can use the Dimensional (demographic/static) data that I already have, to find:
* Month
* Employee name, gender, age
* Incident type, severity
So if we focus on the employee side of this, I only need to pull in data for each employee ONCE, to save space in my data model. The EmployeeID connects this data to every incident that employee reports, which may be MANY over the course of a month or year.
And that is our one to many relationship from Employee to Incidents.
I suggest using a SINGLE cross-filter direction as the default for 1 to many relationships, otherwise you'll get into tricky situations with circular relationships and funny data numbers.
Not all data models are so straightforward though, so feel free to come back with any other info/questions and I'll try to explain as best as I can, and add them to my examples for when I finally get around to writing that blog post. 🙂 - amitchandakSuper User
Anonymous ,
refer
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships
https://www.youtube.com/watch?v=-4ybWQSRcOY
https://www.youtube.com/watch?v=Zlu99RUtMRY
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-many-to-many-relationships
https://radacad.com/many-to-one-or-many-to-many-the-cardinality-of-power-bi-relationship-demystified
- AnonymousNot applicable
Hi Anonymous ,
I think there is enough information provided in the links above.
Incase you want to enroll for a Data Modelling course by SQLBI, here is the link
https://www.sqlbi.com/p/introduction-to-data-modeling-for-power-bi-video-course/
This is a free course and covers key concepts of Data Modelling with Power BI
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)