Forum Discussion

uzairbaig's avatar
uzairbaig
Regular Visitor
2 years ago

DAX , MTD Head count

 I created a DAX to count active employees count of the month and sum it with the count of new hiring requests from each departments to check what will me the total count if we hire new people.
For example i have 10 emplys in IT department and the rerquested to hire 2 more this month so it will show projected line of 12 for this month. 
The problem im facing is  when i select my slicedr to select all departments and sub departments, it shows actual and correct value.
but as soon as i select any department from slicer it doesnot give the correct value.

attatching below pics to explain my query.



without slicer its greenline is showing 13with slicer at HR its also giving 76+13 while correct is 76+2, making green line at 78i tried creating many to many relationship btwn ERF lisyt and query 2 (Departments) but no result.

2 Replies

  • I'm not sure, but try changing this variable

    VAR CurrentDate = MAX('Calendar'[Date])

    to this

    VAR CurrentDate CALCULATE(MAX('Calendar'[Date]), ALLSELECTED('Calendar'[Date]))