Forum Discussion
relationship help
Hi,
Not sure if this is relationship question or maybe a best practice question.. either way, i have 2 tables being loaded into BI.
1. Sales detail
2. Customer dimension (which has a customer name and sales rep name)
The sales detail report has a code for sales reps, it is not clean, which is why we went with using customer name to sales rep name. However there are some accounts being split between two sales reps and i'm not sure of the best way to get the reporting to work.
Example below: Honda is primarily sold from Sam (sales code 1), but sometimes sold by Bob (sales code 2).
Ford is similar, sales primaril from Bob (sales code 2), but sometimes sold by Tyler (sales code 5).
I understand if i create a sales code dimension and build the relationship off that to get the sales rep name correct but the problem is the data by sales code is very messy and we are much cleaner using customer name at this time. But there are a few accounts that are actually split where we want to have dual owners for one customer.
thank you for the feedback.
Sales data
| Customer | Sales Code | Sales $ |
| Honda | 1 | 500 |
| Ford | 2 | 600 |
| Chevy | 3 | 700 |
| Nissan | 4 | 100 |
| Toyota | 5 | 200 |
| GMC | 6 | 300 |
| Chevy | 3 | 600 |
| Nissan | 4 | 700 |
| Toyota | 5 | 100 |
| Chevy | 3 | 300 |
| Nissan | 4 | 500 |
| Toyota | 5 | 200 |
| GMC | 6 | 250 |
| Honda | 1 | 100 |
| Honda | 1 | 50 |
| Honda | 2 | 350 |
| Honda | 1 | 400 |
| Ford | 5 | 500 |
| Ford | 2 | 250 |
| Ford | 2 | 300 |
Customer dimension
| Customer name | Sales Rep |
| Honda | Sam |
| Ford | Bob |
| Chevy | Gina |
| Nissan | Debbie |
| Toyota | Tyler |
| GMC | Dave |
Output:
| Customer | Sales Code | Sales $ | Rep Name (from customer dimension) |
| Honda | 1 | 500 | Sam |
| Ford | 2 | 600 | Bob |
| Chevy | 3 | 700 | Gina |
| Nissan | 4 | 100 | Debbie |
| Toyota | 5 | 200 | Tyler |
| GMC | 6 | 300 | Dave |
| Chevy | 3 | 600 | Gina |
| Nissan | 4 | 700 | Debbie |
| Toyota | 5 | 100 | Tyler |
| Chevy | 3 | 300 | Gina |
| Nissan | 4 | 500 | Debbie |
| Toyota | 5 | 200 | Tyler |
| GMC | 6 | 250 | Dave |
| Honda | 1 | 100 | Sam |
| Honda | 1 | 50 | Sam |
| Honda | 2 | 350 | Sam |
| Honda | 1 | 400 | Sam |
| Ford | 5 | 500 | Bob |
| Ford | 2 | 250 | Bob |
| Ford | 2 | 300 | Bob |
Correct output:
| Customer | Sales Code | Sales $ | Rep Name off Sales Code |
| Honda | 1 | 500 | Sam |
| Ford | 2 | 600 | Bob |
| Chevy | 3 | 700 | Gina |
| Nissan | 4 | 100 | Debbie |
| Toyota | 5 | 200 | Tyler |
| GMC | 6 | 300 | Dave |
| Chevy | 3 | 600 | Gina |
| Nissan | 4 | 700 | Debbie |
| Toyota | 5 | 100 | Tyler |
| Chevy | 3 | 300 | Gina |
| Nissan | 4 | 500 | Debbie |
| Toyota | 5 | 200 | Tyler |
| GMC | 6 | 250 | Dave |
| Honda | 1 | 100 | Sam |
| Honda | 1 | 50 | Sam |
| Honda | 2 | 350 | Bob |
| Honda | 1 | 400 | Sam |
| Ford | 5 | 500 | Tyler |
| Ford | 2 | 250 | Bob |
| Ford | 2 | 300 | Bob |
2 Replies
- parry2kSuper User
Anonymous somewhere you have to store the definition of sales code, I don't see any other way.
- v-xuding-msftCommunity Support
Hi Anonymous ,
How do you split the accounts? For the current scenario, you need to re-split them if it is hard to create a table with code and sales rep.
There are a few blogs about splitting columns. You could have a try firstly.
How to Split Columns in Power BI