Power BI: how to fix the error “Object reference not set to an instance of an object”

·

Have you ever come across the error message “Object reference not set to an instance of an object” when connecting to a data source in Power BI. This article explains how to fix this error.


Table of context

  1. Why does this error happen?
  2. How to fix
    1. Connect to an Oracle database
    2. Connect to a Sharepoint File
    3. Connect to SAP BW
    4. Connect to R Script

Why does this error happen?

This error message is very generic and indicates that Power BI tried to access something that doesn’t exist (more specifically an instance that hasn’t been started). It typically occurs when attempting to connect a Power BI report to a data source.

The Power BI engine relies on drivers that enable integration between Power BI and data sources to ensure data consumption. This error may arise due to an installation issue with the driver on your machine or a bug introduced in a specific version of the driver.


How to fix

The fix depends on the data source being used. In this section, I will outline these errors for known data sources. If you encounter this error with a different data source not covered here, please leave a comment so we can work together to find a solution 🙂

For all scenarios below, make sure your Power BI Desktop platform is the same as your Window (both must be 32-bit or 64-bit). If your Power BI Desktop does not match the architecture, reinstall to the correct version. If you don’t know how to identify your Windows version, check out: How do I tell if my computer is running a 32-bit or a 64-bit version of Windows?

Connect to an Oracle database

In this scenario, your report is using a connection to the Oracle database. Make sure to follow these steps:

  1. Ensure that you have the ODAC (Oracle Data Access Components) driver installed correctly. Be sure to install the version that corresponds to your operating system (64-bit or 32-bit).
  2. Navigate to the folder where the driver was installed. Typically, the path is something like “C:\Oracle\product\12.2.0\client_1”, although it may vary slightly if you chose a different directory during installation or depending on your ODAC version. However, the key folder of interest is “client_1”.
    • Another example of a possible path is: “C:\Oracle\ORA112\product\11.2.5\client_1\bin”, and this may vary depending on your ODAC version.
  3. Copy the “oraons.dll” file from the “client_1” folder to the “bin” subfolder (located at “C:\Oracle\product\12.2.0\client_1\bin”)

After completing the steps above, restart your Power BI Desktop and try connecting to the data source again.

Connect to a Sharepoint File

When attempting to connect to a SharePoint file, an error message is displayed. Check out some possible solutions:

  • It has been reported that this error occurred in the Power BI Desktop version of OCT21 (version: 2.98.6830). Update your Power BI Desktop to the latest version.
  • Ensure that when connecting to Sharepoint, your URL starts with https:// instead of http://
  • Expand the error details and if there is the message “Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters” it means that one of the files you are reading is corrupt. Try opening this file in the appropriate software, for example, if it is a spreadsheet, open it in Microsft Excel, and try to save it as a new file and replace the previous one.
  • Update to latest version of WebView 2.
    • If it still doesn’t work, do the following: open the cmd (terminal), to do this press the shortcut key Window key + R, then type cmd and click ok. With cmd open type: setx PQ_ExtendEdgeChromiumOAuthDenyList SharePoint;Web then restart Power BI Desktop.

Connect to SAP BW

When browsing the SAP BW cubes and queries, instead of showing the data preview, this error message appears.

Update to the latest version of SAP .Net Connector 3.0, DO NOT USE version 3.1 which is not currently supported. Restart Power BI desktop and try again.

If the problem persists, further investigation will be necessary, which will require support from your SAP BW IT team. Basically, this team should investigate whether your user have access to some BAPI functions to obtain metadata and data from SAP InfoProviders. The modules are: BAPI_MDPROVIDER_GET_CATALOGS, BAPI_MDPROVIDER_GET_CUBES, BAPI_MDPROVIDER_GET_DIMENSIONS, BAPI_MDPROVIDER_GET_HIERARCHYS, BAPI_MDPROVIDER_GET_LEVELS, BAPI_MDPROVIDER_GET_MEASURES, BAPI_MDPROVIDER_GET_MEMBERS, BAPI_MDPROVIDER_GET_VARIABLES, BAPI_IOBJ_GETDETAIL.

To resolve this issue, check whether the user has access to the various MDPROVIDER modules and BAPI_IOBJ_GETDETAIL.

Connect to R Script

This error usually happens when the platform version of your Power BI Desktop does not match the version of your R (or R Studio). Make sure they are both 32 bits or 64 bits, if one is from one platform and the other from another, this error will happen.

If you are experiencing this error with another data source, please share details in the comments.

2 responses to “Power BI: how to fix the error “Object reference not set to an instance of an object””

  1. I get that error when trying to launch the desktop application. Please help.

    Like

Leave a comment

Subscribe

Create a website or blog at WordPress.com