Forum Discussion

ZacWatkins's avatar
ZacWatkins
New Member
4 years ago
Solved

Count Distinct Rows where Distinct Rows have at least X occurences

Hello!   I have what is most likely a measure request for sorting some data out of my general tables and into a visualization.   Right now I have a table with Employees and SubmissionIDs, plus a ...
  • YukiK's avatar
    4 years ago

    This is one way to do this:

    Distinct Cnt of Employees Where Submission gt 2 =
    VAR __SubmissionsPerEmployee =
    ADDCOLUMNS(
    SUMMARIZE(
    'Table',
    'Table'[employeeName]
    ),
    "@CntOfSubmissions", CALCULATE( COUNTROWS( 'Table' ) )
    )
    
    VAR __Result = CALCULATE( DISTINCTCOUNT( 'Table'[employeeName] ), FILTER( __SubmissionsPerEmployee, [@CntOfSubmissions] > 2 ) )
    RETURN
    __Result