Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi, really stuck on this one. I have the following DAX formula which works fine if I want the number of active employees for each month.
Date[Date] > Fact_HRData[Start Date]
Date[Date] > Fact_HRData[Leaving Date]
However, what I need is a breakdown for each month by department. At the moment I just get this
What I want is the DAX formula to split out the totals for each month by the relevant department. Slicers for the department give me the same result so I suspect it somethings within my original DAX formula but can't figure out what it is.
Any help will be appreciated
The OR function takes only 2 arguments. You've got 3 in there.
There are only 2 in my DAX statement and that DAX works. I just need it expanding to split by Department. The OR in the 1st response has 3 arguments which has already been pointed out to the poster.
Please active relationship for Date[Date] > Fact_HRData[Start Date] then try below code
CALCULATE (
DISTINCTCOUNT ( 'Fact_HRData'[Employee Id] ),
ALLSELECTED ( 'Fact_HRData'[Employee Id] ),
FILTER (
VALUES ( 'Fact_HRData'[Start Date] ),
'Fact_HRData'[Start Date] <= MAX ( 'Date'[Date] ),
),
FILTER (
VALUES ( 'Fact_HRData'[Leaving Date] ),
OR (
'Fact_HRData'[Leaving Date] >= MIN ( 'Date'[Date] ),
ISBLANK ( 'Fact_HRData'[Leaving Date] ),
USERELATIONSHIP('Fact_HRData'[Leaving Date] , 'Date'[Date] )
)
)
)
Cheers for the quick response but I get errors with this DAX formula as per below :
If I remove the comma I then get this error :
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |