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
Espen1515
Advocate I
Advocate I

Creating multiple relationships

Hi,

 

I am having trouble creating the proper relationships between my tables. I have four separate tables, and my problem is connecting them in the same way. I am pretty new to Power BI, so I believe the problem is due mostly to my lack of basic knowledge. I have made a mock-up example below.

 

Project table: Project number is a unique value

Package table: The package number is unique to a project, but could occur more than once in the table (just not more than once per project)

Package shipment table: The shipment number is unique

Package shipment details table: The shipment item is unique per shipment number

 

Project table image.pngPackage table image.pngPackage shipment table image.pngPackage shipment details table image.png

 

So if I try to establish relationships here, for example "Count of shipment items on package number A on Project 1, I am not able to set this up. Any tips? I have managed to establish the relationship between Project number in all tables, but don't know how to handle the fact that package number is Unique per project.

 

With kind regards,

Espen Lütken

1 ACCEPTED SOLUTION

Hi Lydia,

 

Thanks for your reply!

My question is not really concerning getting up that measure that I used as an example, but about how to establish a relationship between these tables. In reality these tables have thousands and thousands of lines and I need to be able to make counts, measures, etc. appear by themselves as soon as I filter. And to do that the tables need to have relationships between them. 🙂

View solution in original post

4 REPLIES 4
v-yuezhe-msft
Employee
Employee


@Espen1515 wrote:

 

 

Project table image.pngPackage table image.pngPackage shipment table image.pngPackage shipment details table image.png

 

So if I try to establish relationships here, for example "Count of shipment items on package number A on Project 1, I am not able to set this up. Any tips?


@Espen1515,

Does the following measure return your expected result?

Measure = CALCULATE(COUNT('Package shipment'[Shipment number]),FILTER('Package shipment','Package shipment'[Project number]=1 && 'Package shipment'[Package number]="A"))

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

 

Thanks for your reply!

My question is not really concerning getting up that measure that I used as an example, but about how to establish a relationship between these tables. In reality these tables have thousands and thousands of lines and I need to be able to make counts, measures, etc. appear by themselves as soon as I filter. And to do that the tables need to have relationships between them. 🙂

Greg_Deckler
Super User
Super User

I am thinking that you will need to create a table of unique Project/Package codes.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi, I am not quite sure what you mean. Isn't that what the Package table already does? There is a unique package on each project, but can as I say occur more than once in the table as it can occur on a second project.

 

For example, on Project 1 there is only 1 unique package called "Furniture", but Furniture can also occur in Project 2. But maybe you mean something else. Is it possible to be more specific? Or include a short description of what a table like that would like like as opposed to those that already exist?

 

 

Thanks!

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.

Top Solution Authors
Top Kudoed Authors