New Hired Employee

Dear Experts
I want to know how to create Dax Measure that counts the Number of New Hiring Employees each month based on HireDate field, I attached the DB with this post.

Thank you

Human Resources.xlsx (307.6 KB)

@MAAbdullah47,

This is one of those scenarios where you can use a very simple measure and just let the evaluation context do all the heavy lifting for you:

New Employees = COUNTROWS( Employee_Data )

image

I hope this is helpful.

3 Likes

Hi @MAAbdullah47, did the response/training content provided by @user help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!

1 Like

Hi @EnterpriseDNA
I Just Recive it I’ll test and get back to you.

Thank you so Much Yes It works.

It works but before Confirm the solution I have one more Question, On My DB I have 2 Fields of date (Employment Date, Leave Date) and the Schema Between Dates table and employees (Transactions) as the following:


Date to Emplyment Date (Active Relationship)
Date to Leave Date (Not Active relationship)

Does this make problem in the future for the solution?

@MAAbdullah47,

Shouldn’t cause an issue, but any measures that you use with the Non Active Relationship you will have to use the USERELATIONSHIP function in order for it to work correctly. Here is a link to great resource on that function:

https://info.enterprisedna.co/dax-function-guide/userelationship/

You can also use TREATAS function if you delete in the inactive relationship all together. Here is a link for that function:
https://info.enterprisedna.co/dax-function-guide/treatas/

Thanks
Jarrett

1 Like

@MAAbdullah47,

To add to @JarrettM“ points above, usually in this situation, I will set both relationships to inactive to force myself to be intentional about which relationship I’m using, and to make it explicit to others who may be viewing my DAX.

Absolutely nothing wrong with the way you have it, but wanted to raise that as another option.

  • Brian
2 Likes