Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How can I create a relationship between rows in one table and multiple columns in another table?

Hello,

This doesn't have to be a relationship, but I presume, a measure would solve it as well. To clarify what I'm doing, I'm adding two example tables that I came up. Finally, to be clear, my whole report is working fine, and unpivoting columns unfortunately breaks my other measures.

 

Table1:

 

ContractSportspersonNationalitySalary
TemporaryMessiArgentina97M
Full TimeRonaldoPortugal70M
Short TermNeymarBrazil76M

 

Table2:

 

Income TypeMessiRonaldoNeymar
Modelling20M35M10M
Construction5M2M1M
Influencer200K500K1M

 

I want to ensure, for example, if someone clicks on Argentina, it shows both incomes from the regular salary and side-jobs. 

 

Thanks, 

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @Anonymous 

 

In Power Query, duplicate Table 2 and unpivot columns so that the names of the players are in rows. You can then link Table 1 to Table 3, and recreate measures as necessary. 

 

Hope this helps.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

3 REPLIES 3
TheoC
Super User
Super User

Hi @Anonymous 

 

In Power Query, duplicate Table 2 and unpivot columns so that the names of the players are in rows. You can then link Table 1 to Table 3, and recreate measures as necessary. 

 

Hope this helps.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Anonymous
Not applicable

Thanks @TheoC 

I was hesitant to do this, because I have to create a number of new measures, which I know, I will have issues with. In fact, one of my measures is already failing, I'm getting a blank calculation. I'm trying to calculate the total gains per year. What do you think is going wrong here?

 

Unpivotted Table = CALCULATE(SUMX('Table1', 'Table1'[Year] = "2021"), Table1'[Player] = "Messi" || Table1'[Player] = "Ronaldo" || Table1'[Player] = "Neymar")  

 

Or, do you have other recommendations for my initial question?

 

Many thanks in advance, 

Anonymous
Not applicable

Oops! I've managed to solve it, thanks to your support @TheoC 
As reference to someone else looking for info, I changed my measure with SUM and FILTER. Created relationships, and now it's working.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.