Forum Discussion
Correcting Errors in PATH
Hello All,
I am using the PATH statement to create a 'chain of command'.
Due to the volume of employees and turn over; there are a number of times when the terminated employee still appears in the user's 'Reports to' field.
I usually get the error "The value John Doe in results[reports to] must also exist in results[full name], please add the missing data and try again"
When the PATH command fails, if fails for all values with #ERROR even the entries that still have a valid PATH.
How can I determine what entries will fail and default them to our CEO?
Cheers!
Peter
Hi Anonymous , I suggest adding a column and replace the names that don't appear in Full Name column with your CEO's name. Then use this column in your PATH statement instead of the original Reports to column.
Example:
Reports to (Backup) = LOOKUPVALUE('Employees'[Full Name],'Employees'[Full Name],'Employees'[Reports to],"Tomas") Path = PATH('Employees'[Full Name],'Employees'[Reports to (Backup)])Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
4 Replies
- DataZoeMicrosoft Employee
Anonymous I don't have PATH data to play with so I wasn't able to test it, but have you tried using IFERROR?
https://docs.microsoft.com/en-us/dax/iferror-function-dax
- AnonymousNot applicable
Hello If have tried the IFERROR and it does not work on the PATH statement:
PATH = IFERROR(PATH(Results[Full Name],Results[Reports to]),"Justin")Still yeilds #ERROR in alll values for the column. I also get an error"The value 'KristenD' in [Reports to] does not appear in [Full Name]. Please add the missing data".This makes sense as Kristen was terminated, but the 30 people that she had reporting to her, have not changed.Cheers,Peter- v-jingzhangCommunity Support
Hi Anonymous , I suggest adding a column and replace the names that don't appear in Full Name column with your CEO's name. Then use this column in your PATH statement instead of the original Reports to column.
Example:
Reports to (Backup) = LOOKUPVALUE('Employees'[Full Name],'Employees'[Full Name],'Employees'[Reports to],"Tomas") Path = PATH('Employees'[Full Name],'Employees'[Reports to (Backup)])Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.