Forum Discussion
One slicer for two tables-relations
- 9 years ago
Ok - so a slicer that uses a field in the Customer table will filter data in both of the other tables. Try adding Sales Area to a slicer and you should see what I mean.
So, if you want a slicer with Sales Rep name to filter both tables you will need to somehow get Sales Rep name into the Customer table (or create a new 'lookup' table with Sales Rep and unique Customer Numbers).
One way to do this is to follow these steps:
1. Click Edit Queries
2. Right click on Query1 and select Reference
3. In the new query that is created, remove all columns except Sales Rep and Customer Number
4. Right click on the Customer Number column and select Remove Duplicates
Then you can create a relationship between customer number in this new table and customer number in the Query1 and Visits tables.
Finally, use Sales Rep name from this new table in your slicer
(Note, though, that any customers in the Visits table that aren't in the Query1 table will not be linked to a Sales Rep name. It would be better if you had a table with all customers and their Sales Reps...but that may not be readily available)
Ok - so a slicer that uses a field in the Customer table will filter data in both of the other tables. Try adding Sales Area to a slicer and you should see what I mean.
So, if you want a slicer with Sales Rep name to filter both tables you will need to somehow get Sales Rep name into the Customer table (or create a new 'lookup' table with Sales Rep and unique Customer Numbers).
One way to do this is to follow these steps:
1. Click Edit Queries
2. Right click on Query1 and select Reference
3. In the new query that is created, remove all columns except Sales Rep and Customer Number
4. Right click on the Customer Number column and select Remove Duplicates
Then you can create a relationship between customer number in this new table and customer number in the Query1 and Visits tables.
Finally, use Sales Rep name from this new table in your slicer
(Note, though, that any customers in the Visits table that aren't in the Query1 table will not be linked to a Sales Rep name. It would be better if you had a table with all customers and their Sales Reps...but that may not be readily available)
Sweet! Took me a while to understand, but now it works just as I wanted it to.
Thanks!