Fix Power BI refresh error: “Could not load file or assembly … or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid”

·

Are you trying to update your Power BI report, both in the Power BI Desktop and the Power BI service, and encountering an error similar to the message below:

The solution to this issue depends on the environment where the refresh is being performed (Power BI desktop or Power BI service) and the type of connector. Throughout this article, we will describe the solutions for each of these scenarios.


Table of contents

  1. How to fix
    1. Oracle
    2. PostgreSQL
    3. SQL Server
    4. SQL Server Analysis Services (= connecting to a semantic model/dataset)

How to fix

For each of the scenarios below, there are two steps that should be checked if you are attempting to refresh from your Power BI Desktop (from your machine) or through the Power BI service (via a gateway). So, before proceeding to the next steps, ensure that the requirements below are met according to your scenario.

Refreshing from power bi desktop: 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?

Refreshing from power bi service: ensure that you are updating to the latest version of the gateway installed on your machine (if you are using a cluster, make sure all machines in the cluster have the latest version of the gateway installed). If you are using a cluster, ensure that the steps outlined below are executed for each machine in the cluster. If one of the cluster machines is configured incorrectly, the error will be intermittent (it will only occur when the processing request is directed to the machine with the incorrect configuration).

Oracle

Ensure that you have the ODAC (Oracle Data Access Components) driver installed correctly on your machine (or all machines in the cluster, if you have one). Be sure to install the version that corresponds to your operating system (64-bit or 32-bit). Ensure that during the installation process, an entry is created in the Global Assembly Cache (GAC). Typically, GAC files are installed in the directory C:\Windows\Microsoft.NET\assembly. Verify if there are files installed in each of these folders:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Oracle.ManagedDataAccess


C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess


Repair the installation of the .NET Framework. For this, Microsoft provides a tool that can be downloaded here.

After the installation, try refreshing your report again.

PostgreSQL

Since the December 2019 release of Power BI Desktop, the driver for connecting to PostgreSQL is included with the Power BI installation, and manual installation is not required. However, if you are encountering an error message, we recommend directly installing the driver, which can be found here. Look for version 4.0.10 (NpgSQL 4.1 and up won’t work due to .NET version incompatibilities), download, and run the .msi file. Ensure that the architecture (32-bit or 64-bit) of your operating system matches that of the driver. During installation, make sure you select the “NpgSQL GAC” option.

Repair the installation of the .NET Framework. For this, Microsoft provides a tool that can be downloaded here.

After the installation, try refreshing your report again.

SQL Server

By default, Power BI installs OLE DB drivers for SQL Server. However, Microsoft’s own documentation recommends installing the SQL Server Native Client (versions 11.0 or 10.0) for improved performance.

Additionally, repair the installation of the .NET Framework. For this, Microsoft provides a tool that can be downloaded here.

After the installation, try refreshing your report again.

SQL Server Analysis Services (= connecting to a semantic model/dataset)

Ensure that you have installed the MSOLAP, AMO, and ADOMD clients for proper Power BI connection with Analysis Services. You can find the latest versions of these clients for download at this link.

Additionally, repair the installation of the .NET Framework. For this, Microsoft provides a tool that can be downloaded here.

After the installation, try refreshing your report again.

If you encounter the error message in a scenario not listed here, leave it in the comments so we can try to find a solution together 🙂

Leave a comment

Subscribe

Create a website or blog at WordPress.com