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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Last year count with userelationship dax

Hi experts,
Need to calculate last year new hire count 
Please help.

 

New Hire =
CALCULATE(
COUNT('Exit,Roster,Leave,WFH'[ID]),
USERELATIONSHIP('Calendar'[Date], 'Roster'[Hire Date]))

New Hire PY =
CALCULATE( DISTINCTCOUNT('Roster'[ID]),
SAMEPERIODLASTYEAR('Calendar'[Date]),
USERELATIONSHIP('Calendar'[Date], 'Roster'[Hire Date]))

getting blank output for second formula

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.  Show the problem there clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Venkateshchiluk
Frequent Visitor

Hi @Anonymous  This modified formula will count the number of new hires for the previous year based on the 'Hire Date' relationship with the 'Calendar' table.
CALCULATE(
COUNT('Exit,Roster,Leave,WFH'[Axtria ID]),
USERELATIONSHIP('Calendar'[Date], 'Roster'[Hire Date]),
'Calendar'[Year] = YEAR(TODAY()) - 1
)

Anonymous
Not applicable

Hi @Venkateshchiluk, I tried above formula, shwoing blank value 

Date intelligence....try to use DATEADD or SAMEPRIODELASTYEAR to get your result.

CALCULATE(
     COUNT(ccc),
     DATEADD(xxx),
     USERALTIONSHIP(fff)
)


Regards.

Anonymous
Not applicable

Hi @sergej_og ,

New Hire PY =
CALCULATEDISTINCTCOUNT('Roster'[ID]),
SAMEPERIODLASTYEAR('Calendar'[Date]),
USERELATIONSHIP('Calendar'[Date], 'Roster'[Hire Date]))

tried above and getting blank output 
Anonymous
Not applicable

Hi, @Anonymous 

Have you solved the current problem? I looked at your DAX expression and it seems to be correct. Are you able to provide some sample data or PBIX files that don't contain privacy?

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors