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

Relationship between two Tables

Hi all,

So I have two tables, 'Outlets Table' and 'Customer/Distributor Table' as shown in the dummy tables below. I need to create a relationship betwen the two tables so that I can show Comparison in number of outlets and number of customers for each distributor in a single visual. Kindly, advise how I can relate the two tables and achieve the above.

 

Any feedback will be highly appreciated, thanks.

Outlets Table
Outlet IDOutlet NameDistributor CodeDistributor name
111Outlet A1DIST A
112Outlet B2DIST B
113Outlet C2DIST B
114Outlet D3DIST C
115Outlet E3DIST C
116Outlet F1DIST A
Customer/Distributor Table
Customer CodeCustomer NameDistributor Code
UG347Customer12
KE328Customer23
TZ782Customer33
ET328Customer41
CM237Customer52
1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Kaskazi_Network ,

 

Based on your description, you can do some steps as follows.

  1. Create a many-to-many relationship between two tables.

v-yuaj-msft_0-1606351535803.png

 

  1. Create a table visual. (Choose “count(distinct)”)

v-yuaj-msft_1-1606351535805.png

 

Result:

v-yuaj-msft_0-1606351639765.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuaj-msft
Community Support
Community Support

Hi @Kaskazi_Network ,

 

Based on your description, you can do some steps as follows.

  1. Create a many-to-many relationship between two tables.

v-yuaj-msft_0-1606351535803.png

 

  1. Create a table visual. (Choose “count(distinct)”)

v-yuaj-msft_1-1606351535805.png

 

Result:

v-yuaj-msft_0-1606351639765.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

@Kaskazi_Network , you can create a many to many join on distributor code.

 

There is an option of bridge table distributor code, but I doubt that will serve the purpose here https://www.seerinteractive.com/blog/join-many-many-power-bi/

 

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.