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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
gluizqueiroz
Resolver I
Resolver I

How to connect 2 columns with 1 column? Relationship about home and away teams

I am creating a project about football games and I have 2 columns named HomeTeam and AwayTeam o a table named Games and I have another table name Teams that contains information about the teams, 1 team per line.


I need to create a relationship between this 2 tables (Games and Teams), but I can't connect the table Teams with column HomeTeam or column AwayTeam, it can't be "one or another", is there any to connect 2 columns with 1 column? 

When the user choose the game, for example, 49ers x Seahawks, the table teams should show information about this 2 teams.

 

Table Games

Id_GameHomeTeamAwayTeam
149ersSeahawks
2CowboysGiants
3CardinalsBengals
4BrownsPackers
5SteelersVikins

 

 

Table Teams

Name_TeamYear_FundationOther Information
49ers1950Info
Seahawks1946Info
Cowboys1976Info
Giants1980Info
Cardinals1840Info
Bengals1955Info
Browns1945Info
Packers1939Info
Steelers1971Info
Vikings1960Info

 

1 ACCEPTED SOLUTION

may be you can use this way:

 

1. Create Duplicate table with the same data from Teams.  So, we have three tables. I call these as

   a. Games   b. Home Teams   c. Away Teams.

2. Now, create relationship based on names (see below).

 

relationship.png

 

Now, Use table visual to input fields like this and don't forget to select is not blank from the visual filter. (see below)

 

 

2019-03-18 11_16_22-Window.png

 

 

 

View solution in original post

3 REPLIES 3
rocky09
Solution Sage
Solution Sage

can you share some data of two tables??

Hey @rocky09!

I updated the question with some data.

may be you can use this way:

 

1. Create Duplicate table with the same data from Teams.  So, we have three tables. I call these as

   a. Games   b. Home Teams   c. Away Teams.

2. Now, create relationship based on names (see below).

 

relationship.png

 

Now, Use table visual to input fields like this and don't forget to select is not blank from the visual filter. (see below)

 

 

2019-03-18 11_16_22-Window.png

 

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.