cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

PATH function returns Loop error

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

10110
102B11
10C1
11D1
1Enull

 

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

10110
102B11
10C101
11D1
1Enull

 

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

 

 

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

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

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors