Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JoeAnalyst
New Member

We were unable to load this Excel file because we couldn't understand its format.

Hi,

I have a automated solution in place about 10 months but few days ago, the scheduled refresh of the report published to Powerbi Service started to not finish the refresh and stooppped on error: "DataFormat.Error: We were unable to load this Excel file because we couldn't understand its format. File contains corrupted data.. Microsoft.Data.Mashup.ErrorCode = 10942. ;We were unable to load this Excel file because we couldn't understand its format. File contains corrupted data.. The exception was raised by the IDbCommand interface. ".

The solution uses scheduled exports from the company application , the exported files have xlsx format and are saved using Power Automate to the sharepoint folder. The exported data file is not corrupted, it has no password, sensitivity label and it seems it did not change formating at all (I compared older exports = looked the same). I tried many times to export file, change data in the report. The powerBI desktop works fine with that xlsx fomat, I can reload data, all steps in power query work. I tried to republish to the other workspace but no change. The scheduled refresh on service simply stopps on the error message. It worked I think until Friday 13th 2025 (the date? :-). I have noticed new PowerBI version was released on June 10th with some new features about sensitivity lableling but this should not be the case. Why does it work in Dektop but not after publish? Any good advice from anyone? Thank you in advance.

1 ACCEPTED SOLUTION
fr_jc
Advocate II
Advocate II

@JoeAnalyst  Managed to get a work around which works for me by running an empty office script in the power automate flow to act as an open and save.  

After the create file action, use an excel Run Script action.

function main(workbook: ExcelScript.Workbook) {
  // This script doesn't need to make any explicit changes or call a 'save' method.
  
  // You can add a simple log to confirm it ran if you wish, but it's not strictly necessary.
  console.log("Office Script ran successfully for workbook: " + workbook.getName());
}

 

View solution in original post

14 REPLIES 14
gbroughton
New Member

Exact same problem for me, also Salesforce data.

Poojara_D12
Super User
Super User

Hi @JoeAnalyst 

You're encountering a frustrating issue where a previously stable Power BI report—automated for over 10 months—suddenly fails to refresh in the Power BI Service, despite working flawlessly in Power BI Desktop. The error message points to a DataFormat.Error with code 10942, indicating that the Excel file is seen as having a corrupted format or unreadable structure. However, you’ve confirmed that the file is structurally sound, has no password protection or sensitivity labels, and opens fine in Power BI Desktop, which suggests the file itself is not actually corrupted. The XLSX files are generated via scheduled exports from your company application and stored on SharePoint via Power Automate, and nothing significant has changed in the export logic or formatting.

 

Given that everything works in Desktop but fails in the Service, the issue likely stems from how the Power BI Service is attempting to parse or access the Excel file in the cloud environment. A key difference could be the version of the mashup engine or stricter validation in the Service following the June 10th Power BI update, which may have introduced changes to how the service handles Excel files, possibly around metadata, internal structure, or SharePoint file locking. One possible root cause is that the exported Excel file—though appearing normal—might be slightly malformed or still being written or locked when Power BI Service attempts to access it, especially if the refresh schedule overlaps closely with file generation.

 

To mitigate this, try the following steps: (1) introduce a buffer time between file export and dataset refresh, (2) check if opening and saving the Excel file manually (e.g., via Excel desktop or online) "fixes" the issue, and (3) consider using CSV format instead, which is less error-prone in automated workflows. If the issue persists, it might be worth opening a support case with Microsoft—even if you're on Power BI Pro, this type of regression affecting file compatibility might be considered for escalation if enough users report it.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
fr_jc
Advocate II
Advocate II

@JoeAnalyst  Managed to get a work around which works for me by running an empty office script in the power automate flow to act as an open and save.  

After the create file action, use an excel Run Script action.

function main(workbook: ExcelScript.Workbook) {
  // This script doesn't need to make any explicit changes or call a 'save' method.
  
  // You can add a simple log to confirm it ran if you wish, but it's not strictly necessary.
  console.log("Office Script ran successfully for workbook: " + workbook.getName());
}

 

Could you please describe the flow in more detail? Preferably with a screenshot? Unfortunately, I don't know where I need to enter the code after adding the additional action.

@Olze-Kay  
start with Excel and go to the Automate tab and click on ‘New Script’

fr_jc_0-1750227111401.png

 

In the editor that will pop up on the left, delete everything and replace it with,

function main(workbook: ExcelScript.Workbook) {}

then save the script with a name of your choice, the script will save in your office scripts folder of your OneDrive

 

fr_jc_1-1750227237566.png

 

In your power automate flow, add a new activity, Excel Online (Business) Run script after your create file action which is likely a SharePoint or OneDrive create file action.

Fill in the four fields for the Runs script action as,

 

Location: the location where you created the file, choose OneDrive for business if you created the file on your one drive, else the sharepoint location you created it.
Document Library: should be Documents

File: use dynamic content and add body/Id     when you over it should show something like the below,  assuming your previous create file action is labelled Create file,

outputs('Create_file')?['body/Id']

 

Script: you should find the script you just created in here, select that one.

fr_jc_3-1750227504057.png

 

That is it..  good luck..

Thank you very much for the super quick reply. I hadn't considered the first step in Excel.

Same problem for me (Salesforce exports as Excel files, goes to Power Automate and then a Power BI dataset). I got the same error as well for some days.

I manually opened and saved all the files arrived since the error appeared. After that, the refresh worked. I added this script as you described, I'll see if it works for the next ones. Thanks a lot!

Thank you, this works and it is great workaround!

fr_jc
Advocate II
Advocate II

only salesforce files for me failing since 2025-06-15

hipkid
New Member

I have the same issue since a few days ago. My source files didn't change 😞

Sve_on
New Member

I have the same flow and I encountered the same issue. What is the source in your case? My files have been exported from SalesForce

Yes, SalesForce :-).

PapaJoe0418
Regular Visitor

No solution from me, but I want to report the same thing happening since a day or two ago. If there are enough similar reports, then it may be a Microsoft internal issue and we'd be spinning our wheels to try to fix it. I have date stamps on my Power BI reports, so I know if the latest data is included on my user-facing views. So far, all I need to do is reload the browser window and it appears to be working, even with the Refresh error. Still validating output, but gave up on debugging. 

No solution for me either, I will be trying the script workaround shortly, but have the same issue as above with Salesforce files being emailed to me in xlsx format, the Power Automate stores them in SharePoint.  No changes were made to this process, but on 6/15/25 this error message started.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.