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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Jsummers
Helper I
Helper I

Distinct Count Help

Hi, hoping someone can help, I think it is probably pretty simple, but with my lack of knowledge, I am just banging my head against a brick wall!

I have a table, one column is an assessment ID, there are multiple rows with the same assessment ID.  I have a second column called NCs, there is either a 1 or 0 in that column.  I want to create a measure to count the number of rows with 1 in for distinct assessment IDs.

 

I have something like this, but it's not working!

Audits with NCs = CALCULATE(DISTINCTCOUNT('SQL Ad Hoc'[AssessmentID]),FILTER('SQL Ad Hoc','SQL Ad Hoc'[NCs?]="1" && 'SQL Ad Hoc'[NCs?]="1"))
 
Many thanks 
Julia
1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

Hi, @Jsummers 

Try below

Audits with NCs = CALCULATE(DISTINCTCOUNT('SQL Ad Hoc'[AssessmentID]),'SQL Ad Hoc'[NCs?]=1))

View solution in original post

4 REPLIES 4
HotChilli
Community Champion
Community Champion

Can you clarify the desired result please? I don't think this is clear "I want to create a measure to count the number of rows with 1 in for distinct assessment IDs."

Do you want a distinct count of AssessmentID (with the table filtered for NC = 1)

or

do you want a count of NC = 1 rows for each AssessmentID?

or something else?

--

If you provide sample data and show the desired result you will get a better answer.

Capture.JPG

This is the desired outcome

Dangar332
Super User
Super User

Hi, @Jsummers 

Try below

Audits with NCs = CALCULATE(DISTINCTCOUNT('SQL Ad Hoc'[AssessmentID]),'SQL Ad Hoc'[NCs?]=1))

@Dangar332 this appears to have worked, I will double check the results & then accept as the solution, many thanks 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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