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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply

Understanding Headcount (Dax for Allexcept, All) Part 2

Hi All,

 

Referencing my previous question here - Solved: Re: Understanding Headcount (Dax for Allexcept, Al... - Microsoft Fabric Community

 

Let us assume that I came in to work on 1/15, 1/26, 1/30, 2/16 and 2/27. 

I have to find 2 things 

1. Total Attendance: Which is how many individuals come to the office. Based on the dates of attendance, my total attendance if I filter/slice for January, should be 3 and that for February should be 2

2. Head Count: Which is unique appearance per time period. So if I filtered for January, my attendance is 1, and the same goes for February. 

 

I have 2 measures to solve for the same - 

For Total Attendance - Total Emp Count = COUNT('Badging Data'[EmployeeID])
For Head Count - Unique BadgeIns = CALCULATE(DISTINCTCOUNT('Badging Data'[EmployeeID]), ALLSELECTED('Badging Data'))
Apart from slicing by the date hierarchy, I am also slicing by Business Group, Division, Dept, etc. 
 
I have 2 pages - one for Total Attendance and one for Headcount. 
 
My problem is that when I use the Head Count measure - Unique BadgeIns - it does nothing to the visuals. It simply calculates the total and shows that result across all visuals. 
 
The first screenshot is of the Total Attendance Page, which is working as expected.
anonymoususer92_0-1726829323609.png

 

The second screenshot is of the Head Count Page which is not giving the correct values in the visuals except for the KPI Cards
 
anonymoususer92_1-1726829497250.png

 

Any help from the community is greatly appreciated !! 
@Anonymous 
Thanks in advance
 
PS: If it helps, below is a dummy data for 2024 with 3 employees.
 
Employee Full NameEmployeeIDEnterBadgeDate
M11/3/2024
M11/17/2024
M11/24/2024
M11/31/2024
E22/6/2024
M12/6/2024
D32/7/2024
E22/7/2024
M12/7/2024
D32/8/2024
E22/8/2024
M12/8/2024
E22/23/2024
M12/23/2024
E22/27/2024
M13/6/2024
E23/12/2024
M13/14/2024
M13/20/2024
E24/1/2024
E24/2/2024
M14/11/2024
M14/16/2024
M14/17/2024
M14/24/2024
M15/2/2024
E25/7/2024
M15/7/2024
E25/22/2024
M15/23/2024
E25/28/2024
E25/30/2024
D36/4/2024
M16/4/2024
E26/11/2024
E26/12/2024
M16/12/2024
E26/19/2024
M16/19/2024
E26/26/2024
M17/16/2024
E27/16/2024
M17/17/2024
D37/17/2024
E27/17/2024
M17/24/2024
E27/24/2024
D38/6/2024
M18/6/2024
E28/6/2024
D38/7/2024
M18/7/2024
E28/7/2024
D38/8/2024
E28/8/2024
M18/8/2024
M18/12/2024
E28/12/2024
M18/21/2024
E28/26/2024
M18/27/2024
M18/28/2024
E28/29/2024
M19/4/2024
M19/12/2024
M19/18/2024
E29/18/2024
1 REPLY 1
dk_dk
Super User
Super User

Hi @anonymoususer92 

 

I think you can just get rid of the ALLSELECTED in your CALCULATE. Alternatively try modifying your measure as follows:

Unique BadgeIns = CALCULATE(DISTINCTCOUNT('Badging Data'[EmployeeID]), ALLSELECTED('Badging Data'),Table[Division Name] = SELECTEDVALUE(Table[Division Name])

where Table is the name of the table that contains the Division Name used in the treemap.

Hope this helps!






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors