Forum Discussion
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 ID | Outlet Name | Distributor Code | Distributor name |
| 111 | Outlet A | 1 | DIST A |
| 112 | Outlet B | 2 | DIST B |
| 113 | Outlet C | 2 | DIST B |
| 114 | Outlet D | 3 | DIST C |
| 115 | Outlet E | 3 | DIST C |
| 116 | Outlet F | 1 | DIST A |
| Customer/Distributor Table | ||
| Customer Code | Customer Name | Distributor Code |
| UG347 | Customer1 | 2 |
| KE328 | Customer2 | 3 |
| TZ782 | Customer3 | 3 |
| ET328 | Customer4 | 1 |
| CM237 | Customer5 | 2 |
- Anonymous5 years ago
Hi Kaskazi_Network ,
Based on your description, you can do some steps as follows.
- Create a many-to-many relationship between two tables.
- Create a table visual. (Choose “count(distinct)”)
Result:
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.
2 Replies
- amitchandak
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/
- AnonymousNot applicable
Hi Kaskazi_Network ,
Based on your description, you can do some steps as follows.
- Create a many-to-many relationship between two tables.
- Create a table visual. (Choose “count(distinct)”)
Result:
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.