Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Distinct countx?

I have a dataset where I want to create two measures, one is the total count of employees and the other is the total count of employees who are on a particular assignment. I know would have to use the countx(filter()) functions to the latter, but I am not sure how to make the count distinct while using countx. How would this be accomplished?

  • Total Employees = DISTINCTCOUNT ( Table[Employee] )

    Total Employees (on Assignment X) =
    CALCULATE (
        [Total Employees],
        FILTER ( Table, Table[Assignment] = "Assignment X" )
    )

    Hope this helps! :smileyhappy:

2 Replies

  • Sean's avatar
    Sean
    Community Champion
    Total Employees = DISTINCTCOUNT ( Table[Employee] )

    Total Employees (on Assignment X) =
    CALCULATE (
        [Total Employees],
        FILTER ( Table, Table[Assignment] = "Assignment X" )
    )

    Hope this helps! :smileyhappy:

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yup, thanks!