Forum Discussion

GKK1's avatar
GKK1
Icon for Helper II rankHelper II
2 years ago
Solved

Urgent Help requires Slicer to filter data from two datasets

Hi Power BI community! Anonymous user

 

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 DeptOp DeptWork Hours
Kid's clothingCash80
Men's ClotingCash90
Wommen's ClothingCash50
ToysCash45
CosmeticsCash35
ElectronicsCash20
Home DécorCash15
Credit CardCredit Card40
Gift CardsGift Cards45
SupportSupport50
Sales DeptOp DeptSales Dollars
Kid's clothingCash5000
 Credit Card4500
 Gift Cards6000
Men's ClotingCash3500
 Credit Card4000
 Gift Cards6000
Wommen's ClothingCash4500
 Credit Card5000
 Gift Cards4500
ToysCash6000
 Credit Card3500
 Gift Cards4000
CosmeticsCash6000
 Credit Card4500
 Gift Cards5000
ElectronicsCash4500
 Credit Card6000
 Gift Cards3500
Home DécorCash4000
 Credit Card6000
 Gift Cards4500
  • Anonymous's avatar
    Anonymous
    2 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

  • Anonymous's avatar
    Anonymous
    Not 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's avatar
      GKK1
      Icon for Helper II rankHelper 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's avatar
      GKK1
      Icon for Helper II rankHelper 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 DeptOp    DeptWork Hours
      Gift CardsGift Cards45



      Sales DeptOp DeptSales Dollars
      Kid's clothingGift Cards6000
      Men's ClotingGift Cards6000
      Wommen's ClothingGift Cards4500
      ToysGift Cards4000
      CosmeticsGift Cards5000
      ElectronicsGift Cards3500
      Home DécorGift Cards4500
      • Anonymous's avatar
        Anonymous
        Not 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

  • 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 Deptop DeptWork Hours
    Kid's clothingCash80
    Men's ClotingCash90
    Wommen's ClothingCash50
    ToysCash45
    CosmeticsCash35
    ElectronicsCash20
    Home DécorCash15
    Total 3350

     

    Sales DeptOp DeptSales Dollars
    Kid's clothingCash5000
    Men's ClotingCash3500
    Wommen's ClothingCash4500
    ToysCash6000
    CosmeticsCash6000
    ElectronicsCash4500
    Home DécorCash4000
    Total 33500

     

    When I select Slicer as Gift Card:

    Slicer
    Credit Card

     

    Work Force Deptop DeptWork Hours
    Credit CardCredit Card40
    Total 40

     

    Sales DeptOp DeptSales Dollars
    Kid's clothingCredit Card4500
    Men's ClotingCredit Card4000
    Wommen's ClothingCredit Card5000
    ToysCredit Card3500
    CosmeticsCredit Card4500
    ElectronicsCredit Card6000
    Home DécorCredit Card6000
    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