Forum Discussion

garythomannCoGC's avatar
garythomannCoGC
Icon for Impactful Individual rankImpactful Individual
1 year ago
Solved

The key didn't match any rows in the table. Does data model table order matter?

power bi desktop, power query, expression error "The key didn't match any rows in the table" Does the table order matter in relation to the data model when referenced in power query? I believe it d...
  • garythomannCoGC's avatar
    garythomannCoGC
    1 year ago

    v-hashadapu Thanks.  I get the gist of what you have said one point for trying.
    Still doesn't make logical sense though.  
    Now I get that the order of steps visually are not processed by the Power Query engine in any particular order.  But it is only one let .. in block

    Here is the first Fails screenshot again including the whole screen so we can see the steps on the rhs.


    More screenshots with the 'table' declarations out of order with NotificationsIE moving up till we get a possible error.

     

     

     

     

     

    Now lets try and break it :}

    This begs the question why the difference between the 
    " SelectColumns = Table.SelectColumns(NotificationIE, { ... "  statement and the Table.NestedJoin 's ?

    Broken, essentially the same as the first fails screenshot.  We now reference Assets indirectly even though NotificationsIE has an indirect reference that works.

     

    Now lets move steps around illogically and see what happens.

    Works but record count for NotificationsIE is back to 1.7m and not the 1.2k expected.  
    So order does matter :}