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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
SonyaJ
New Member

Calculated Measure Not Changing with Filter

I am trying to count employees over 2 years, who are new hires using the below formula, however this is only returning data for one month not for the full time.

=CALCULATE(COUNT([Employee Id]),FILTER('HR Demographics Data','HR Demographics Data'[NewHire]="Y"))

Screenshot 2024-11-26 092244.png

Any idea on what i am doing wrong?

5 REPLIES 5
sevenhills
Super User
Super User

 

=CALCULATE(COUNT([Employee Id]),FILTER( ALL('HR Demographics Data'),'HR Demographics Data'[NewHire]="Y"))

 

OR

 

=CALCULATE(COUNT([Employee Id]),FILTER(ALLSELECTED('HR Demographics Data'),'HR Demographics Data'[NewHire]="Y"))

Thanks 

 

Both of these worked, it is now giving a number for each month, however not the correct number.  It is giving the number for Jan for every month.

SonyaJ_0-1732575600813.png

 

Yes, All or allselected uses all your data in the table. and hence you see the same values in all months.

 

Not sure if you are building this kind:

https://learn.microsoft.com/en-us/power-bi/create-reports/sample-employee-hiring-history

https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/HR-Analytics-Active-Employee-Hire-... 

 

I am wanting to see the active employees and then of those how many are new hires for the month?  How would i do this?

 

We dont have your data or .pbix file and cannot say correct DAX.

 

It is not hard. Filter the year and month and other columns using ALL or ALLSELECTED with SELECTEDVALUE.

 

~ Check the first link and download the .pbix file and look the New Hires page.

Check "isNewHire" and "New Hires". 

sevenhills_0-1732576722103.png

sevenhills_1-1732576735743.png

 

 OR 

 

Check this link, it also has the same 

https://community.fabric.microsoft.com/t5/Desktop/Employee-Turnover-with-Date-Hierarchy/m-p/558408

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors