Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

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?
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

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
)
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

vanessafvg
Community Champion
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?  





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
vanessafvg
Community Champion
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?  





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




amitchandak
Super User
Super User

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
)
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Yes it worked, thank you!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.