Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Finding the distinct IDs from filtered data

Measure Trainees Completed Course =
CALCULATE (
COUNTROWS(Training),
FILTER (
Training,
SEARCH ( "Completed", Training[Status],, BLANK () ) > 0
|| SEARCH ( "Complete", Training[Status],, BLANK () ) > 0
)
)
 
From my measure above, I'm trying to determine the count of unqiue traineeIDs that fulfill the filter requirements. I've tried applying the distinct function to the COUNTROWS(Training) and selecting for the trainee ID column in the training table, while applying the ALL function inside the FILTER function but that didn't work. How would I go about getting only the distinct values for this calculation?
  • this did not work for you ?

    CALCULATE (
    distinctcount(Training[trainee id]),
    FILTER (
    Training,
    SEARCH ( "Completed", Training[Status],, 0 ) > 0
    || SEARCH ( "Complete", Training[Status],, 0) > 0
    )
    )
  • Anonymous  not sure i quite understand what you asking, did you say you tried this

    Measure Trainees Completed Course =
    CALCULATE (
        DISTINCTCOUNT ( [trainingid] ),
        FILTER (
            Training,
            SEARCH ( "Completed", Training[Status],, BLANK () ) > 0
                || SEARCH ( "Complete", Training[Status],, BLANK () ) > 0
        )
    ) but it didn't work? What are you trying to do?  

3 Replies

  • this did not work for you ?

    CALCULATE (
    distinctcount(Training[trainee id]),
    FILTER (
    Training,
    SEARCH ( "Completed", Training[Status],, 0 ) > 0
    || SEARCH ( "Complete", Training[Status],, 0) > 0
    )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes it worked, thank you!

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    Anonymous  not sure i quite understand what you asking, did you say you tried this

    Measure Trainees Completed Course =
    CALCULATE (
        DISTINCTCOUNT ( [trainingid] ),
        FILTER (
            Training,
            SEARCH ( "Completed", Training[Status],, BLANK () ) > 0
                || SEARCH ( "Complete", Training[Status],, BLANK () ) > 0
        )
    ) but it didn't work? What are you trying to do?