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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
H_insight
Helper V
Helper V

Dax to count employee with/without sales

Hi, 

 

I have dummy data for employee and their sales values.

 

I am trying to get a dax code for the following:

- Count of Emp Sales: count number of employees (by unique id) who made a sale (regardless of the values including 0) ( only to exclude blanks).

- Count sales: count of sales per manager

- Count of no sales:  count of no sales per manager

 

Expected outcome based on the sample data:

ManagerTotal EmployeeCount of Emp SalesCount of SalesCount of no Sales
Basilius Josip4462
Drika Eurig5462
Eadburga Yasmeen4362
Gergana Nellie2253
Halvor Suerius2280
Jamal Mohan33102
Kağan Dreda66186
Mari Felizitas1271
Shahin Zlata2271
Vendelín Rati2271
Total31308020

 

Sample pbix file.

 

Many thanks.

 

 

1 ACCEPTED SOLUTION

Hi @H_insight 

 

Try this:

 

Count of Emp Sales =
CALCULATE(DISTINCTCOUNT(Data[Emp ID]),filter(Data,Data[CurrentValue]<>blank()))
 
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

View solution in original post

4 REPLIES 4
Whitewater100
Solution Sage
Solution Sage

Hi Heshamk:

That was interesting! If you have a data model vs. flattened file it will be better for any kind of analysis.

Please see link for results:

https://drive.google.com/file/d/1SNTX1VLuiWsDODT_rYGXKNl5OPBbeFAO/view?usp=sharing

Hi @Whitewater100 

 

Thanks for the quick response. I appreciate I have a flat file, but it's only due to having a sample file 🙂

 

I think most of my requirements has been delivered, except "Count of Emp Sales", where out of the 31 unique employees, only 1 didnt make any sales. The outcome should be 30.
I.e. Manager Drika Eurig, have 5 employees. 4 made sales excet 1.

 

Hope that helps.

Hi @H_insight 

 

Try this:

 

Count of Emp Sales =
CALCULATE(DISTINCTCOUNT(Data[Emp ID]),filter(Data,Data[CurrentValue]<>blank()))
 
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

Thank you @VahidDM .

 

The measure is delivering the expected outcome.

 

Thanks all for your help

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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