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

Relationship with more than 1 field

Hi. I have 3 tables:

 

A) Transactional data: Month - Country - ID

B) Capacity: Month - Resources - Country

C) Consumption: Month - Hours - ID

 

In Table 1 month and country can appear more than once, but ID is unique

In Table 2 every month appears once per country (basically each country appears 12 times to reflect the capacity per month)

In table 3 ID appears once, as indicates how many hours each ID is consuming  

 

I need to show per country the consumption vs the capacity. I'm struggling on the relationships. Can anyone give me a hint? I understand I need to build multiple relationships, but I'm not sure how.

 

Thanks

 

Ezequiel

4 REPLIES 4
ezequiel
Employee
Employee

Hi @amitchandak . Your solution seems to work but I just realized I don't have Month in the consumption table, just ID. What would be the solution in that case? Thanks again,

Hi @ezequiel ,

You can refer the method in the following links to create the proper relationship. If they are not applicable for your scenario, please share some sample data in your model and final expected result in order to provide a suitable solution.

Creating Relationship Based on Multiple Fields in Power BI Using TREATAS DAX Function

Create a relationship with multiple columns in Power BI

Relationship in Power BI with Multiple Columns

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

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

@ezequiel , Create new columns as suggested below and join

 

Consumption
C1 = [Month] & " " & [ID]

Transactional data: Month - Country - ID
C1 = [Month] & " " & [ID] // Join with C1 of Consumption
C2 = [Month] & " " & [Country] // Join with C2 of Capacity

Capacity: Month - Resources - Country
C2 = [Month] & " " & [Country]

mhossain
Solution Sage
Solution Sage

@ezequiel 

 

If you make relationship like below:

Capacity[Country] to Transaction[Country]

Transaction[ID] to Consumption[ID]

 

Use Country field from Transaction while dragging to table or visual for dimension.

 

If above doesn't work, please share the dummy data.

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.