Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Distinct Count of Projects Containing Specific Team Members

Hi All,     I have Roster table that has a column of Projects (repeating values) and I need to count how many Projects have been assigned multiple Job Titles.   For Instance:   PROJECT JOB...
  • stevedep's avatar
    stevedep
    6 years ago

    Hi,

    the code:

    Measure = 
    var __Filter = CALCULATETABLE(FILTER('Table';[JOB TITLE] in {"Manager"; "Tech"});ALLEXCEPT('Table';'Table'[PROJECT]))
    return 
    IF(
        HASONEVALUE('Table'[PROJECT]);
            if(COUNTROWS(__Filter)>=2;1;0);
                COUNTROWS(
                    FILTER(
                        CALCULATETABLE(SUMMARIZE(__Filter;'Table'[PROJECT];"c"; DISTINCTCOUNT('Table'[JOB TITLE])));[c]>=2
                        )
                    )
    )

    As seen here:

    File.

    Pls marks as solution if this works for you. Thumbs up for the effort would be great. 

    Kind regards, Steve.