Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
@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());
}
I don't understand the root of the problem. My files come from Service Now. Some of the users here don't use a flow from Power Automate but get the same error, so the flow is not the problem. In fact, my flows run successfully and I opened the files and confirmed the data is updated. How do we raise a ticket with Microsoft?
Hi, the power automate flow is not the problem, in this case it is the advantage to use flow because there is only one working workaround - to add to the flow one small step that after file is saved to the sharepoint it will open/close file automaticaly and it does all the magic. It is enouch open and close (with some void action) and the structure of the xlsx file will be corrected. Power BI is then able to load the file as before. I am not an expert on the xlsx versions but the xlsx export that I use from other sources are ok, only SalesForce generates these 'incorrect' files. I dont know whether Microsoft is troublemaker here, yes, they changed something on PowerBI side on June 10th but if other xlsx versions are fine, maybe the SalesForce app shoud be fixed instead. Anyway the workaround works for now, you can find the guide here in this discussion how to add one more step "Run Script" to the flow with dynamic way how to get file ID so it shoud work olso on your side. From your first post I understood that you already impelented it but it is not working, now it seems you did not yet, so just try to impelent it and you should be safe.
Yes I tend to aggree with "I dont know whether Microsoft is troublemaker here."
I too am no expert but if you look at the Content_Types xml on a new file and an older xlsx file you where getting before the problem started you get,
Look at one from when the problem started and you get a whole lot of <overide> custom entries.
I'd suspect that this is where the query conncetors excel loader fails to read and understand the format.
The open and save action is simply rebuilding the xml back to the orignal state where the excel loader can understand it.
I am experiencing the same problem. The excel files are not corrupted. I have two power automate flows to update the files on sharepoint, one triggers when I get the email with the data extract and another flow triggers daily 4.30am as a backup. The flows run successfuly but when Bi runs the schedule refreshes it fails and I get the same error described by JoeAnalys
Hi, Can you see the files are really updated by the flow? I am able to see in the file Version History that the flow did its job and created new version and also the size of the file is a bit higher (about 200kB). From when I implemneted this workaround about a week ago I havo no more issues. I have 10 files updated daily, all work perfectly.
Hi Joe, thanks for your prompt response. Yes, I can see the files get updated. I will try implementing the work around you used but it is a lot of files, would prefer that whatever is causing this, got fixed. I had no problems before, my report have been running and refreshing with no issues for months.
The script solution didn't work for me. Even the action doesn't recognize the file type. I'm submitting a ticket.
Is there an issue reported for this? We are experiencing the same issue and would like to report it to Microsoft.
I am also having this same issue, running a scheduled Salesforce export as an Excel file, Power Automate pulls it out of Outlook and creates a SharePoint file source for Power Bi. Issue started on June 7, 2025 with no issues for the previous 2 months.
Exact same problem for me, also Salesforce data.
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.
Our first failure was on June 11th. So this is align with what you have said in your post.
I tried a delay action in my Power Automate, but this did not solve the issue.
I have attempted the script solution that @JoeAnalyst suggested, but my trigger is a SharePoint "When a file is created or modifed (properties only)" and the script doesn't work for us.
We can open the file manually and make a small change and save the file and then Power BI service can read the file properly.
I have now opened a ticket under our Pro/Premium support.
All to say, you are most likely right in the root cause.
@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’
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
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.
That is it.. good luck..
This worked perfectly for me! Thanks.
@JoeAnalyst When I add the script in my flow I get an error about the file format not being recognized. "The file format is not recognized. Please check that the selected workbook is valid."
I hypothesize that since I'm not using the "Create file" action and my trigger is that a SP file is "Created or modified" that my action with the script requires an Apply to Each with the script iside. The error still occurs after selecting the dynamic "ID" from the trigger event. I'm lost at this point.
I've been having the users open the file manually and re-save and this has helped with the error, but I would like to return to an automated solution for them.
Any help from anyone that is more familiar with PowerAutomate would be greatly appreciated.
@pb1051 You need to use "Indentifier" instead of "ID". And I also recommend to create the condition only for creation (not modification of the file). As the condition formula you can use timestamps Modified=Created. Otherwise the file will be touched twice: first time when file is uploaded to the folder and again when the flow modifies it.
I didn't receive the file format error this time. Let's hope this does it until Microsoft figures out the root cause.
This worked for me. Really appreciate the response. I had the exact same setup with Salesforce scheduled report.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
28 | |
25 | |
22 | |
21 |
User | Count |
---|---|
63 | |
45 | |
24 | |
24 | |
18 |