Forum Discussion

outteach's avatar
outteach
New Member
21 days ago
Solved

Power Query - Nested table - List.PositionOf - Find substring

This line of M code works perfectly... RowIndexOfCashFlow = Table.AddColumn(AddTableWithIndex, "Row Index of Cash Flow", each List.PositionOf([Data][Column3], "Cash Flow Analysis - Checking *7114:",...
  • ronrsnfld's avatar
    ronrsnfld
    20 days ago

    Hard to tell without a data sample. But if your list is coming from a nested table, and there are nulls in that list (in the column of the nested table), you will see that error.

    You can correct for it by changing the comparer to handle nulls: 

    (x,y)=> Text.Contains(x ?? "",y))

    ?? is the coalesce operator and will convert null to an empty string.

    If that is not the issue, please provide a sanitized example of the actual list you are feeding into the formula. Be sure when you sanitize it that it still reproduces the error.