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
esulli_
Frequent Visitor

DISTINTCOUNT when applying filter

Hi, 

 

I am building a dashboard to display turnover within an organisation but having problems when applying certain filters on my dashboard.

 

I have a simple DAX formula to count the number of employees which works as intended. 

No. of Employees = DISTINCTCOUNT('Capacity Mock'[Emp No.]) 

 

However when I apply a filter through a drop down slicer on my dashboard to view what department they were from the count does not alter. A filter works to show me the count of no. of employees from each Location but it does not give me a filtered count for a specific department. Both Location and Department are coming from different data sets so I am unsure if it is because my relationships are incorrect, or is there another DAX formula I can use?

 

I have attached copies of my data set in the comments below 

 

Any help would be great, thanks.

 

5 REPLIES 5
selimovd
Super User
Super User

Hey @esulli_ ,

 

your data model seems to be a little bit confusing. Can you share the file or at least the formulas?

It's important to know from which tables you try to count and in which table you are using for the analysis.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Capacity Mock

 

Emp No.DateHoursDept at time YearMonthDay
101/04/20159Hairdresser 20150401
102/04/20154Hairdresser 20150402
103/04/20159Hairdresser 20150403
104/04/20150Hairdresser 20150404
105/04/20150Hairdresser 20150405
106/04/20154Hairdresser 20150406
107/04/20159Hairdresser 20150407
108/04/20159Hairdresser 20150408
109/04/20154Hairdresser 20150409
110/04/20159Hairdresser 20150410
111/04/20150Hairdresser 20150411
112/04/20150Hairdresser 20150412
113/04/20154Hairdresser 20150413
114/04/20159Hairdresser 20150414
115/04/20159Hairdresser 20150415
116/04/20154Hairdresser 20150416
117/04/20159Hairdresser 20150417
118/04/20150Hairdresser 20150418
119/04/20150Hairdresser 20150419
120/04/20154Hairdresser 20150420
121/04/20159Hairdresser 20150421
122/04/20159Hairdresser 20150422
123/04/20154Hairdresser 20150423
124/04/20159Hairdresser 20150424
125/04/20150Hairdresser 20150425
126/04/20150Hairdresser 20150426
127/04/20154Hairdresser 20150427
128/04/20159Hairdresser 20150428
129/04/20159Hairdresser 20150429
130/04/20154Hairdresser 20150430
201/04/20157Grocers 20150401
202/04/20157Grocers 20150402
203/04/20157Grocers 20150403
204/04/20150Grocers 20150404
205/04/20150Grocers 20150405
206/04/20157Grocers 20150406
207/04/20157Grocers 20150407
208/04/20157Grocers 20150408
209/04/20157Grocers 20150409
210/04/20157Grocers 20150410
211/04/20150Grocers 20150411
212/04/20150Grocers 20150412
213/04/20157Grocers 20150413
214/04/20157Grocers 20150414
215/04/20157Grocers 20150415
216/04/20157Grocers 20150416
217/04/20157Grocers 20150417
218/04/20150Grocers 20150418
219/04/20150Grocers 20150419
220/04/20157Grocers 20150420
221/04/20157Grocers 20150421
222/04/20157Grocers 20150422
223/04/20157Grocers 20150423
224/04/20157Grocers 20150424
225/04/20150Grocers 20150425
226/04/20150Grocers 20150426
227/04/20157Grocers 20150427
228/04/20157Grocers 20150428
229/04/20157Grocers 20150429
230/04/20157Grocers 20150430
301/04/20157Florist20150401
302/04/20157Florist20150402
303/04/20157Florist20150403
304/04/20150Florist20150404
305/04/20150Florist20150405
306/04/20157Florist20150406
307/04/20157Florist20150407
308/04/20157Florist20150408
309/04/20157Florist20150409
310/04/20157Florist20150410
311/04/20150Florist20150411
312/04/20150Florist20150412
313/04/20157Florist20150413
314/04/20157Florist20150414
315/04/20157Florist20150415
316/04/20157Florist20150416
317/04/20157Florist20150417
318/04/20150Florist20150418
319/04/20150Florist20150419
320/04/20157Florist20150420
321/04/20157Florist20150421
322/04/20157Florist20150422
323/04/20157Florist20150423
324/04/20157Florist20150424
325/04/20150Florist20150425
326/04/20150Florist20150426
327/04/20157Florist20150427
328/04/20157Florist20150428
329/04/20157Florist20150429
330/04/20157Florist20150430
401/04/20157Gym20150401
402/04/20157Gym20150402
403/04/20157Gym20150403
404/04/20150Gym20150404
405/04/20150Gym20150405
406/04/20157Gym20150406
407/04/20157Gym20150407
408/04/20157Gym20150408
409/04/20157Gym20150409
410/04/20157Gym20150410
411/04/20150Gym20150411
412/04/20150Gym20150412
413/04/20157Gym20150413
414/04/20157Gym20150414
415/04/20157Gym20150415
416/04/20157Gym20150416
417/04/20157Gym20150417
418/04/20150Gym20150418
419/04/20150Gym20150419
420/04/20157Gym20150420
421/04/20157Gym20150421
422/04/20157Gym20150422
423/04/20157Gym20150423
424/04/20157Gym20150424
425/04/20150Gym20150425
426/04/20150Gym20150426
427/04/20157Gym20150427
428/04/20157Gym20150428
429/04/20157Gym20150429
430/04/20157Gym20150430

 

Only a sample of this data as table was to large to post

Turnover 

 

Emp No.Leave DateLeave ReasonYearMonthDayLeave Identifier

217/05/2015Voluntary20150517217052015
702/05/2015Retirement20150502702052015
810/04/2015Early Retirement20150410810042015
1230/05/2015Retirement201505301230052015
1613/04/2015Voluntary201504131613042015
1830/04/2015Voluntary201504301830042015
2020/05/2015Retirement201505202020052015

Staff Details

LocationEmp No.SexStart Date

Blue City1M07/06/2010
Red Town2F03/06/2010
Blue City3F14/06/2010
Blue City4F14/06/2010
Red Town5F01/07/2010
Blue City6M01/07/2010
Blue City7F26/07/2010
Blue City8F02/08/2010
Blue City9F20/09/2010
Blue City10F20/09/2010
Red Town11M01/04/2011
Red Town12F01/04/2011
Red Town13F01/04/2011
Red Town14F01/04/2011
Red Town15M01/04/2011
Red Town16F01/04/2011
Red Town17M01/04/2011
Red Town18F01/04/2011
Red Town19F01/04/2011
Red Town20M01/04/2011

'Capacity Mock' contains details of every day an employee has worked within a specific period and details of their employment, within this data is their department they work, which I would like to use as a filter.

 

Within this data set there is a DAX formula of 

No. of Employees = DISTINCTCOUNT('Capacity Mock'[Emp No.]) 

 

'Staff Details' which usually holds information on the employees (please see below). This is where the filter Location is being pulled from which seems to work fine with filters. 

 

The final data table is 'Turnover' (see below) this contains records of everyone who has left. Within this data table there are DAX formulas of 

Total No. of Leavers = DISTINCTCOUNT(Turnover[Emp No.])

No. of Vol Leavers = CALCULATE(COUNTROWS(Turnover),Turnover[Leave Reason]="Voluntary")

 

In my dashboard I would like to filter through different departments (please see drop box on left hand side of below screenshot i.e Arcade, etc) however it only seems to filter between both Locations 'Blue City' or 'Red Town' and not each department. 

 

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.