Forum Discussion

PVO3's avatar
PVO3
Impactful Individual
4 years ago
Solved

Power Query Expression.Evaluate errors

Hello I'm looking for some help,

 

In Power Query I have a table name 'Output' like below. It just looks for a name given in DropDownVar and it returns the table with this name. It works perfectly in PQ and preview looks good.

 

let
    Source = Expression.Evaluate(DropDownVar, #shared)
in
    Source

 

Unfortunatly, whenever I press apply it returns this error:

Failed to save modifications to the server. Error returned: xxx column does not exist in the rowset

I can't figure out what is wrong.

 

Perhapse because I read that the function is not fully implemented. In that case, is there a workaround?

 

Attempts:

- Table names are created so Expression.Evaluate can handle them (no mathematic operators or spaces).

- Whenever I remove the 'Output' table everything works fine. So no errors in other tables.

- Whenever I change DropDownVar in a static table name, the PQ preview is correct again, but the apply will fail exactly the same. So the problem is not DropDownVar.

- Whenever I remove the given column from the source table or the 'Output' table it will give the error below. Again the PQ preview is correct.

OLE DB or ODBC error: Exception from HRESULT: 0x80040E4E. An unexpected exception occurred

- Whenever I remove multiple columns from the 'Output' table I get the error below. Again the PQ preview is correct.

Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [Expression.Error] We cannot convert the value null to type Table.. An unexpected exception occurred.

 

Anyone has a clue?

 

Ps. in this example file, the apply from PQ works, but for whatever reason the output table is empty while it works fine in PQ preview.

  • PVO3 

    Thank you for providing the sample pbix. Use an explicit environment.

     

    = Expression.Evaluate(DropDown,[A=A,B=B])

     

     

     

1 Reply

  • PVO3 

    Thank you for providing the sample pbix. Use an explicit environment.

     

    = Expression.Evaluate(DropDown,[A=A,B=B])