Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All,
I was trying to get the employee and their managers using PATH function.
I did got the path function, but then, after few days it thrown an error that, the employee list is in loop.
For example:-
Sample Data:-
EMPLOYEE_ID . NAME . MANAGER_ID
101 | A | 10 |
102 | B | 11 |
10 | C | 1 |
11 | D | 1 |
1 | E | null |
Now in above senario the output of path function is perfect.
But then, because of some system issues or data updation issues, the data comes to our system as below format.
EMPLOYEE_ID . NAME . MANAGER_ID
101 | A | 10 |
102 | B | 11 |
10 | C | 101 |
11 | D | 1 |
1 | E | null |
Here 101 emp reports to 10 and 10 reports to 101, then path function throws error that employee list is in loop as 101|10|101. and this looping may occure at any stage. right now in our organization 15 Levels are there.
So, To solve this i have to remove that emp id and then re run the query which is so hectic and im loosing few of the employees data.
Can anyone please guide me how can i overcome this issue.
Thanks,
Mohan V
Hi @Anonymous ,
The PATH() function can't handle the loop condition, actually, the loop condition like 101 report to 10 and 10 report to 101 is also invalid.
In your scenario, we'd better set a check on the data source to avoid this problem.
Best Regards,
Teige
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
71 | |
70 | |
38 | |
28 | |
26 |
User | Count |
---|---|
97 | |
88 | |
59 | |
43 | |
40 |