Forum Discussion
Urgent Help requires Slicer to filter data from two datasets
I have two datasets, one with Employee hours worked in different departments and the other with Sales of the store in these departments. The issue is that the hours dataset
has a few different departments as compared to the sales (Credit Card, Gift Card and Support). I do have Operational departments in both datasets as well. I need to use a slicer to get the operational deparments selected from both datasets which will give me sales dollars from sales dataset and the hours worked in those departments from the work force departments.
But I have issues in doing so:
1- The departments in Sales and Hours datasets are not matched 1-1
2- For each Sales Department, I do have Sales from 3 operational departments; i.e. Cash, Credit card, Gift Card. A customer can pay in either of these 3 ways.
3- In the Hours Dataset, I do have hours against only the Hours departments and employees selling Gift Cards and Credit Card have separate hours.
What I want is if from the Slicer, I will select Cash, then I will get all the sales against Cash from each department and from Work force hours data I will get all the departments worked hours.
When I select Credit Card slicer then I will get all the Sales against these operational departments and from the hours I will get worked hours against Credit Card. Same with the Gift Card.
Support , I will get hours when I select support and no sales value.
I would really appreciate it if I will get help do this.
| Slicer |
| Cash |
| Credit Card |
| Gift Cards |
| Support |
| Work force Dept | Op Dept | Work Hours |
| Kid's clothing | Cash | 80 |
| Men's Cloting | Cash | 90 |
| Wommen's Clothing | Cash | 50 |
| Toys | Cash | 45 |
| Cosmetics | Cash | 35 |
| Electronics | Cash | 20 |
| Home Décor | Cash | 15 |
| Credit Card | Credit Card | 40 |
| Gift Cards | Gift Cards | 45 |
| Support | Support | 50 |
| Sales Dept | Op Dept | Sales Dollars |
| Kid's clothing | Cash | 5000 |
| Credit Card | 4500 | |
| Gift Cards | 6000 | |
| Men's Cloting | Cash | 3500 |
| Credit Card | 4000 | |
| Gift Cards | 6000 | |
| Wommen's Clothing | Cash | 4500 |
| Credit Card | 5000 | |
| Gift Cards | 4500 | |
| Toys | Cash | 6000 |
| Credit Card | 3500 | |
| Gift Cards | 4000 | |
| Cosmetics | Cash | 6000 |
| Credit Card | 4500 | |
| Gift Cards | 5000 | |
| Electronics | Cash | 4500 |
| Credit Card | 6000 | |
| Gift Cards | 3500 | |
| Home Décor | Cash | 4000 |
| Credit Card | 6000 | |
| Gift Cards | 4500 |
- Anonymous2 years ago
Hi GKK1 ,
In fact you only need to create relationships between 3 tables to achieve your needs:The results are as follows:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- AnonymousNot applicable
Hi GKK1 ,
In fact you only need to create relationships between 3 tables to achieve your needs:The results are as follows:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- GKK1
Helper II
Thank you very much Anonymous . I really appreciate your support.
Actually I had some wrong relationship built in Sales and hours Department(Many to many). And it was not letting me create the relationship with filters table. With your response I got the idea that I can build a bridge table as Department and then a separate Filter table and then create the relationship as many to one and that worked.
Once again thanks for your help.Best regards,
GK
- GKK1
Helper II
Hi Anonymous ,
I really appreciate your help earlier.
I have a follow up question. I am not sure if I need to create a new post or would it be fine to post in the same one.
My Operational departments slicer is working fine with the Departments. Now I want to have Departments as a slicer as well. And If I select Gift Card from my Department slicer then it will give me the worked hours against Gift Card and all the Sales in different Sales departments against the Gift Card as well.
Similar results for the Credit Card department.
Thanks in advance for your support.Hours Depoartment Slicer Kid's clothing Men's Cloting Wommen's Clothing Toys Cosmetics Electronics Home Décor Credit Card Gift Cards Results :
Work force Dept Op Dept Work Hours Gift Cards Gift Cards 45 Sales Dept Op Dept Sales Dollars Kid's clothing Gift Cards 6000 Men's Cloting Gift Cards 6000 Wommen's Clothing Gift Cards 4500 Toys Gift Cards 4000 Cosmetics Gift Cards 5000 Electronics Gift Cards 3500 Home Décor Gift Cards 4500 - AnonymousNot applicable
Hi GKK1 ,
As before, only two relationships need to be established:Then, generally posts that are marked as ANSWER can no longer ask questions, so please create a new post asking the question and I will answer it for you this time!
Best Regards,
Dino Tao
- GKK1
Helper II
I am not sure if my question is not clear or what I am asking is not possible. I am adding what results I need to see here.
When I select slicer as Cash:Slicer Cash Work Force Dept op Dept Work Hours Kid's clothing Cash 80 Men's Cloting Cash 90 Wommen's Clothing Cash 50 Toys Cash 45 Cosmetics Cash 35 Electronics Cash 20 Home Décor Cash 15 Total 3350 Sales Dept Op Dept Sales Dollars Kid's clothing Cash 5000 Men's Cloting Cash 3500 Wommen's Clothing Cash 4500 Toys Cash 6000 Cosmetics Cash 6000 Electronics Cash 4500 Home Décor Cash 4000 Total 33500 When I select Slicer as Gift Card:
Slicer Credit Card Work Force Dept op Dept Work Hours Credit Card Credit Card 40 Total 40 Sales Dept Op Dept Sales Dollars Kid's clothing Credit Card 4500 Men's Cloting Credit Card 4000 Wommen's Clothing Credit Card 5000 Toys Credit Card 3500 Cosmetics Credit Card 4500 Electronics Credit Card 6000 Home Décor Credit Card 6000 Total 33500 Please guide me how to accomplish these results.
amitchandak I have seen a lot of your posts helping Community members. Please help me resolve this issue as well. I am a newbie to Power BI and in the learning process.
Best regards,
GK