Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
uzairbaig
Regular Visitor

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.

Screenshot 2023-11-09 111505.pngScreenshot 2023-11-09 111526.png

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

2 REPLIES 2
Ahmedx
Super User
Super User

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]))

 no its not working

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.