Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello! I am working on an employee headcount report, where my data builds each day with a new report run date. I am trying to capture the number of active Males and the number of active Females as of today. The measure I'm using to count the active employees is:
Solved! Go to Solution.
@tamerj1 , actually disregard that! I missed entering the actual employee IDs into "emp 1" and "emp 2".
Thank you so much!
@tamerj1 , actually disregard that! I missed entering the actual employee IDs into "emp 1" and "emp 2".
Thank you so much!
Hi @jlaroo33
If these are the only 2 employees tha had the Gender "Not Specified" and there are no other record that has the Gender "Not Specified" then you may try
Active Employees NEW =
CALCULATE (
COUNTROWS ( 'HeadCount_Term_Report NEW' ),
LASTDATE ( 'HeadCount_Term_Report NEW'[Report Run Date] ),
'HeadCount_Term_Report NEW'[Gender] <> "Not Specified"
)
In case you have records that have the gender "Not Specified" other than these 2 employees and you want them to be included with the count then you may try
Active Employees NEW =
VAR ExcludedRecords =
CALCULATETABLE (
'HeadCount_Term_Report NEW',
'HeadCount_Term_Report NEW'[empID] IN { "emp1", "emp2" },
'HeadCount_Term_Report NEW'[Gender] = "Not Specified"
)
VAR LastDateTable =
CALCULATETABLE (
'HeadCount_Term_Report NEW',
LASTDATE ( 'HeadCount_Term_Report NEW'[Report Run Date] )
)
RETURN
COUNTROWS ( EXCEPT ( LastDateTable, ExcludedRecords ) )
Hi @tamerj1 ,
Thank you for looking into my issue. Unfortunately, the second formula that you provided (which is what I want, to include other "Not Specified" employees) did not see to work. Those two records are still being counted.
Thank you, Jodi
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
27 | |
12 | |
11 | |
10 | |
6 |