Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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 :
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |