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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
Continued Contributor
Continued Contributor

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
Continued Contributor
Continued Contributor

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.