Power BI refresh error “could not load file or assembly…provided impersonation level is invalid”

1–2 minutes

Short version

Run Power BI Desktop as administrator before opening the report.

Explanation/Scenario

Recently, when opening a report from Power BI Report Server that used a SQL database as a data source I received the following error.

An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0X80070542)’

So I clicked “Edit Queries” to see what was going on and received almost the same error but referencing a specific table and getting me thinking about SQL specifically.

Error seen after clicking “Edit Queries”

So I checked that table in the query editor and received yet again the same error.

Error seen after clicking the specific table referenced in the previous error message

Simple solution. It’s likely that your credentials and queries are just fine.

The solution for my particular issue here, and the meaning behind the “impersonation level” part of the error, is just that you need to run Power BI Desktop as administrator before accessing the report. After opening the report in Power BI Desktop being ran as an administrator, everything worked as expected.


Discover more from Nate Chamberlain

Subscribe to get the latest posts sent to your email.

5 responses to “Power BI refresh error “could not load file or assembly…provided impersonation level is invalid””

  1. MK Avatar
    MK

    Thank you.it does work for me

  2. Keitho Avatar

    Finally. such a simple solution. Funny how the microsoft guys just tell me to raise a ticket and you have the solution right here. Love it thanks for sharing

  3. rchackoblog Avatar

    This happened to me recently, when i try to refresh from a Azure VM. I reinstalled Power BI with Sep 2020 version and that seems fixed it

  4. Tyler Hering Avatar
    Tyler Hering

    Does anyone know why this issue happens seemingly out of nowhere? I manage many files for a large company, so running as Administrator each time it happens is not ideal (or realistic).. It’s great that we can get passed it, but ultimately I need it to stop happening to begin with.

  5. Tatiana Avatar
    Tatiana

    Merci, Thanks, It worked for me too as administrator.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nate Chamberlain

Subscribe now to keep reading and get access to the full archive.

Continue reading