Forum Discussion

mf123's avatar
mf123
Frequent Visitor
4 years ago

power bi sql server connection -object reference not set to a inatance of an object

i create a couple of months ago a report with power bi,using the sql server connection,with advanced options to type native query

and direct query option,with no issues , but now i want to update a couple of columns so  i download the pbix file from the service, and try to edit it, but when i enter the new query,and hit apply  i get a exception 

object reference not set to an instance of an object

but this only happen when i edit the old report that i download from the service but if i create a new report its working fine  

also the datavarse connection working, only the sql server connection

i already try to uninstall power bi and reinstall it from microsoft store,and also from the web but not helping 

 

3 Replies

  • mf123 , for the downloaded report, check the connection using Home Tab-> Transform data -> Data source settings

     

    If required edit connection or use clear permission (and provide credentials again)

  • mf123's avatar
    mf123
    Frequent Visitor

    thanks for the response,i try this,but its not fixing the issue

     
  • mahenkj2's avatar
    mahenkj2
    Solution Sage

    Hi mf123 ,

     

    Since you say, you are editing native query, then perhaps the reason is: in your query, check if you are including database name such as 'databaseName.dbo.tablename'. if not, just add database name with all table names. Your table may be coming from 2 or more databases so need to tell individual tables. Else may also try to specifiy database name in sql server connection.

     

    Sometimes, we write query in ssms with current database and dont need to specifiy databse name and just copy and paste in PowerBI. but it causes trouble later on.

     

    Hope it helps.