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.
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 July 2025 Power BI update to learn about new features.
User | Count |
---|---|
75 | |
72 | |
39 | |
29 | |
27 |
User | Count |
---|---|
97 | |
96 | |
58 | |
44 | |
40 |