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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
RPYee
Frequent Visitor

One fact, two countries, one country dimension table

I have one fact table related to shipments.  Each shipment has an origin_country_wnbr and a dest_country_wnbr.  We have one country dimension table.  We are often trying to create shipment records where we specify the origin and destination pairs.  How can I bring in the one country dimension table yet create a relationship to both the origin_country_wnbr and the dest_country_wnbr?

1 ACCEPTED SOLUTION
ajohnso2
Super User
Super User

Duplicate your country table (referenced) in power query. 

Now you can setup a new relationship to your newly created country table on destination_country

View solution in original post

6 REPLIES 6
ajohnso2
Super User
Super User

Duplicate your country table (referenced) in power query. 

Now you can setup a new relationship to your newly created country table on destination_country

ryan_mayu
Super User
Super User

pls provide some sample data and expected output.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




You can try to use a ID country?

Not understanding your suggestion.

If you have the county in both tables, add an unique ID for each country and use it for the relationship

The country dim table has a primary_key assigned to each country code.  Could I simply duplicate that key as a new column, then use it to create one of the two relationships needed to the fact table?  I apologize for my lack of experience here.  I am a very new PBI user and certainly appreciate your patience!

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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