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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sjade
Regular Visitor

Using DISTINCTCOUNT to find distinct names in table

I have a table with the following setup:

 

Teamnameskillrating
databasejohn smithSQL server3
databasejohn smithDAX3
databasejimmy plankSQL Server2
engineeringsusie qETL2
engineeringsusie qSQL3
engineeringissac walkerETL1

 

There are about 50 skills per person. And there are a varying number of people on each team. I am trying to write a DAX measure to count the distinct amount of employees on each team. Any suggestions? 

2 ACCEPTED SOLUTIONS
Whitewater100
Solution Sage
Solution Sage

Hi:

If your table name = Team  then

 

DC Team =
var teamname = SELECTEDVALUE(Team[Team])
return
CALCULATE(DISTINCTCOUNT(Team[name]), FILTER(ALL(Team),
Team[team] = teamname))
 
Whitewater100_0-1648141296238.png

 

View solution in original post

Hi:

Yes:

Dist CT =
CALCULATE(
DISTINCTCOUNT(Team[name]),
FILTER(ALL(Team),Team[Team] = EARLIER(Team[Team])))
 
Whitewater100_0-1648146275854.png

 

View solution in original post

6 REPLIES 6
Whitewater100
Solution Sage
Solution Sage

Hi:

If your table name = Team  then

 

DC Team =
var teamname = SELECTEDVALUE(Team[Team])
return
CALCULATE(DISTINCTCOUNT(Team[name]), FILTER(ALL(Team),
Team[team] = teamname))
 
Whitewater100_0-1648141296238.png

 

This is what I am looking for. is there anyway to add this value to the source table as a column? 

Hi:

Yes:

Dist CT =
CALCULATE(
DISTINCTCOUNT(Team[name]),
FILTER(ALL(Team),Team[Team] = EARLIER(Team[Team])))
 
Whitewater100_0-1648146275854.png

 

Thank you so much! 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

Employee count in each team: = 
DISTINCTCOUNT(Data[name])

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi Jihwan:

I'm sorry if I answered after you. I did not see any answer yet when I answered. Thank you..

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.