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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

DISTINCTCOUNT with filter condition doesn't work

Hello all, 

 

I am sort of new to Power BI. I just took a Microsoft Power BI online class. I am tryining to do a simple calculated measure. I want to count all distinct employeeids who's CompanyCategory is "Tradesman". If I run a query in SQL Server or when I look in my data in the Data tab I see the Tradesman values in the table. Seems simple. So I have a DAX formula like this: 

TotalTradesmenCount = CALCULATE( DISTINCTCOUNT(ManpowerRpt[EmployeeID]), FILTER( ManpowerRpt, ManpowerRpt[CompanyCategory] = "Tradesman"))
I also tried this:
TotalTradesmenCount = CALCULATE( DISTINCTCOUNT(ManpowerRpt[EmployeeID]), ManpowerRpt[CompanyCategory] = "Tradesman")
 
When I place a Card on my report and put the calculated measure where I see "(Blank)TotalTradesmenCount". 
What do I do wrong?
Thank you!
Stan
1 ACCEPTED SOLUTION
calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

You have a typo in your measure my friend!

 

You wrote "Tradesman", it should be "Tradesmen".

 

Cheers,

 

Fernando

 

View solution in original post

5 REPLIES 5
calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

Why don't you share your pbix file to understand your data?

Regards,

Fernando

 

Anonymous
Not applicable

Unfortunately, I can't share the file since it has sensitive information. What I can do it to post a snapshot of my table where you can see one row with the CompanyCategory = "Tradesmen":

 

ManPSnap.png

 

I expect to see a numbe 1 in the Card becasue for a distinct count of the empoyees there is only one row that matches the filtering condition.

Anonymous
Not applicable

I have to appologize for my post. This was a simple typo: "Tradesman" instead of a "Tradesmen". This forced me to do a more thorough work when I encounter issues like this.

calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

No worries, this forum is to help users in the community.

 

Just mark the question answered if you agree.

 

Regards,

 

Fernando

 

calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

You have a typo in your measure my friend!

 

You wrote "Tradesman", it should be "Tradesmen".

 

Cheers,

 

Fernando

 

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.