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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.


Go to My LinkedIn Page


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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors