Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need to know the proper DAX to accommodate a couple of data filters on an allocation table.
I need to get headcount that can be filtered by Month where the employee has a start date before on the 1st day of the filtered month AND where their end date is either blank or less than the last day of that filtered month.
An example would be I filter on March:
I want all employees that have a start date <= 3/31/2019 and an end date that is blank or >= 3/1/2019
How do I write a general DAX formulat that takes into count what the filtered month is. I don't want to hard code dates into anything.
Head Count =
CALCULATE (
DISTINCTCOUNT ( Table[Employee ID] ),
where
Table[Start Date] <= Filtered Month (last day of that month)
AND
(Table[End Date] ISBLANK OR Table[End Date]>= Filtered Month( the first day of that filtered month)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |