Forum Discussion
Anonymous
4 years agoNot applicable
Status changes - active/inactive employee record
Desperately need the amazing support of this group to figure this one out. I am trying to determine the position to date per each employee. Any help would be much appreciated!! Facts about the da...
Anonymous
4 years agoNot applicable
I have got the DAX working, however, no values are returning? If anyone can provide any troubleshooting tips that would be so helpful 🙂
Current role - all in one =
VAR _selectedDateRangeEnd=LASTDATE('Date'[Date])
VAR _selectedDateRangeStart=FIRSTDATE('Date'[Date])
VAR _EmploymentsBeforeDateRange=FILTER(
PBIPND_vwPosition_Private,
PBIPND_vwPosition_Private[EndDate]<=_selectedDateRangeEnd)
VAR _LastRoleChangeDate=MAXX(_EmploymentsBeforeDateRange,PBIPND_vwPosition_Private[EndDate])
VAR _RoleChangeHistory=CONCATENATEX(_EmploymentsBeforeDateRange, PBIPND_vwPosition_Private[PositionCode],">",PBIPND_vwPosition_Private[EndDate],ASC)
VAR _lastRole=LOOKUPVALUE(PBIPND_vwPosition_Private[PositionCode],PBIPND_vwPosition_Private[EndDate],_LastRoleChangeDate)
return
if(COUNTROWS(VALUES(PBIPND_vwPosition_Private[StaffNumber]))=1,
"Date range: "&_selectedDateRangeStart&">>"&_selectedDateRangeEnd&"
Count Rows Employment History: "&COUNTROWS(_EmploymentsBeforeDateRange)&"
Role history: "&_RoleChangeHistory&")
Last role: "&_lastRole
)