Forum Discussion

redwings00's avatar
redwings00
Helper I
5 years ago
Solved

Direct - Indirect Report Help

Hello,

I am looking for some assistance with showing Direct and Indirect reports.

 

This previous thread below provided a great start for myself but I am now trying to expand on this.

https://community.powerbi.com/t5/Desktop/how-to-get-direct-and-indirect-employees-count/m-p/329780 

 

What I am now looking to do:

1. Show the count of Direct Reports and Indirect Reports instead of the list of employee ID's

2. Show the employee names instead of the employee ID's

 

I've attached a sample pbix file: https://www.dropbox.com/s/ohs5icepwebdhs0/Direct-Indirect.pbix?dl=0 

 

Any assistance would be appreciated.

 

Thank you,

  • redwings00 Easiest thing would be:

    Measure = IF(ISBLANK([Measure - Direct Reports]),BLANK(),LEN([Measure - Direct Reports]) - LEN(SUBSTITUTE([Measure - Direct Reports],",","")) + 1)

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    redwings00 Easiest thing would be:

    Measure = IF(ISBLANK([Measure - Direct Reports]),BLANK(),LEN([Measure - Direct Reports]) - LEN(SUBSTITUTE([Measure - Direct Reports],",","")) + 1)
    • redwings00's avatar
      redwings00
      Helper I

      Greg_Deckler  - Thank you so much. This works great to get the total counts. Would you know if it would be possible to show the names instead of the ID's?

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        redwings00 Like:

        Measure - Direct Reports 1 = 
        VAR __empid = MAX('Sheet1'[EMP ID])
        VAR direct = FILTER(ALL('Sheet1'),[MANAGER ID] = __empid)
        RETURN
            IF ( ISEMPTY ( direct ) = FALSE (), CONCATENATEX ( direct, [EMPLOYEE NAME], ", " ) )

        I tell people not to use VALUES and CALCULATE but does anyone listen? 🙂