Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have an problem (data doesn't flow). In Power Query there is 1 error table (or 2, but second one is because first).
Error is:
Expression.Error: The index cannot be negative.
Details:
Value=[List]
Index=-1
and when I go to Error, it is in step "fnGetHighestParent".
= (n as number) as number =>
let
PosOfParent = List.PositionOf( ListTeamID, n ),
ParID = ListParentID{PosOfParent}
in
if ParID = null then ListTeamID{PosOfParent} else @fnGetHighestParent(ListParentID{PosOfParent})
In Data View, there is no negative indexes. So I don't know what this error means. Does anyone has any ideas?
Thank in advance!
-G
Solved! Go to Solution.
Hi @Gandhi
List.PositionOf returns -1 if the value being searched cannot be found. There is an optional argument in this function if this happens. Please see this documentation: https://learn.microsoft.com/en-us/powerquery-m/list-positionof
Hi @Gandhi
List.PositionOf returns -1 if the value being searched cannot be found. There is an optional argument in this function if this happens. Please see this documentation: https://learn.microsoft.com/en-us/powerquery-m/list-positionof
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 43 |