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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
SonaSinghA
Helper III
Helper III

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 @SonaSinghA  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
)

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.

Hi @sergej_og ,

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

tried above and getting blank output 

Hi, @SonaSinghA 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.