How it works...

We start by creating a table variable, __Table, based on our data table, R05_Table. In this base table we use the ADDCOLUMNS function to add the __Count column. The formula for the __Count column counts the number of times the ParentEmployeeKey column matches the current row's EmployeeKey column. We do this by using the FILTER function to filter the base data table, R05_Table, to those rows where the ParentEmployeeKey matches our current row's EmployeeKey (EARLIER), and then by counting the number of EmployeeKey values (rows) using COUNTX. Employees that have no children will have a __Count of zero. Thus, we can simply use CONCATENATEX to concatenate all EmployeeKey values in __Table where the __Count column is less than 1.