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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

DAX Help - DISTINCTCOUNT

Hi All, 

I'm a bit stuck on something. What i'm trying to do is get a distinct count of unique employees and then based on these unique employees, i want to get the total sales made by employees who are Full Time. 

So for example, i have a empNo field, EmpStatus field (which contains full time, part time, and casual), and a sales field. 

I can't seem to get my formula to work. I did DISTINCTCOUNT([empNo.] to get unique employee numbers but i can't seem to figure out how to then filter this to return total sales for employees who are full time. 

Thanks all 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You could use "FILTER" in your dax formula.

For example:

Measure = CALCULATE( DISTINCTCOUNT([empNo.] , FILTER( 'Table', [EmpStatus] = "full time"))

 

If not your case, please share some sample data and expected output.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You could use "FILTER" in your dax formula.

For example:

Measure = CALCULATE( DISTINCTCOUNT([empNo.] , FILTER( 'Table', [EmpStatus] = "full time"))

 

If not your case, please share some sample data and expected output.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

Show some data and also the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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