Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Pick manager's team based on slicer

Hello,

 

I created an employee hierachy based on PATH and would like to use slicer to select that manager's team.

 

So, when I pick the name in the slicer's drop down list, the manager's entire team will all be selected.

 

I cannot use PATHITEM as one manager could be at any level. 

 

I tried to use PATHCONTAINS but it doensn't give me what I want.

 

This is my data table:

childID MgrID MgrPath Team

211|2False
411|4False
1231|3|12False
1 1False
1141|4|11False
1051|5|10False
961|6|9False
511|5False
611|6False
311|3False
721|2|7False
811|8False

 

Team = PATHCONTAINS(Sheet1[Mgr Path],SELECTEDVALUE(Sheet1[child ID]))

 

This is the report. Ideally, when I select 1, all the people will show up as everybody reports to 1.

 

Thank you!!!

  • hi, Anonymous 

    You may try this way:

    Step1:

    Add a separate ChildID table for slicer

    childID = VALUES(Sheet1[childID])

    Step2:

    Use this formula to create a measure and use it to set visual level filter

    Measure 2 = PATHCONTAINS(SELECTEDVALUE(Sheet1[MgrPath]),SELECTEDVALUE(childID[childID]))

    Here is pbix file, please try it.

    here is pbix file, please try it.

     

    Best Regards,

    Lin

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

     thanks!!

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, Anonymous 

    You may try this way:

    Step1:

    Add a separate ChildID table for slicer

    childID = VALUES(Sheet1[childID])

    Step2:

    Use this formula to create a measure and use it to set visual level filter

    Measure 2 = PATHCONTAINS(SELECTEDVALUE(Sheet1[MgrPath]),SELECTEDVALUE(childID[childID]))

    Here is pbix file, please try it.

    here is pbix file, please try it.

     

    Best Regards,

    Lin

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you! But is that possible to use Measure 2 as a filter for the other charts? I tried but it didn't work. Ideally, we I pick certain manager at the slicer, all the charts will be filtered to reflect the manager's team stats.

       

      Thanks !