Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello Experts ,
How to find total headcount value from 2006 year to 2013 year (please look into scrrenshot) ? please advise me how to do in DAX . I want to display on card(if i am slecting 2013 year it should be display total headcount value from 2006 to 2013 or if i am selecting 2012 year it should be display total headcount value from 2006 to 2012 )
NP :headcount value ( count of employee id). year (calender table [date])
Please help me or share me DAX script
1. first table HRMS
2. second table calender
Solved! Go to Solution.
Hi @Anonymous
Modify below
measure =
VAR _selectedYear = SELECTEDVALUE('Calendar'[Date].[Year])
RETURN CALCULATE(COUNT(HRMS[EmpId]),FILTER(ALL(HRMS),[Termd]=0 &&YEAR('HRMS'[DateofHire])<=_selectedYear)
)
Best Regards
Maggie
Hi @Anonymous
@Anonymous Please try below measure> I'm assuming 2006 is minimum value for year in your table if not then add one more condition where year(date)>2006
Measure =
VAR _selectedYear = SELECTEDVALUE('Date'[Date].[Year])
RETURN CALCULATE(COUNT(Employee[EmpId]),FILTER(ALL(Employee),YEAR(Employee[DOJ])<=_selectedYear))
Hello vimal_parmar
yeahhh DAX is correct but i want to avoid termination employee ( Date of termination NA means still employed ).So how to avoid and filter this termination employees in this dax .Please advise me
Hi @Anonymous
Modify below
measure =
VAR _selectedYear = SELECTEDVALUE('Calendar'[Date].[Year])
RETURN CALCULATE(COUNT(HRMS[EmpId]),FILTER(ALL(HRMS),[Termd]=0 &&YEAR('HRMS'[DateofHire])<=_selectedYear)
)
Best Regards
Maggie
Yeahhh excellent . Finally solution is done
Thank you so much you are really great vimal & v-juanli-msft
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |