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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Ganchut
New Member

Power BI Rest API - Upload Excel file

Hello. I am new to Power BI and I am trying to publish an Excel file through: https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import.

 

I have created a powershell and I have no problems publishing PBI or RDL, but when I try to publish an Excel file it always returns a 400 error. Could you help me? Thank you very much and greetings.

5 REPLIES 5
Ganchut
New Member

Hi @Anonymous 

 

Effectively I am using the credentials of type "service principal". As I mentioned, I only have problems with Excel files.

These are XLSX, but they do not contain a table with data, but rather a report made with Excel with its connections to SSAS.

From the PowerBI portal, I can import the file without any problem, but when I try to import it through the API, it always returns a 400 error.

 

 

Thank you very much for your help.

Anonymous
Not applicable

Hi @Ganchut,

What version of the excel file are you tested?  According to the document, the current it only supports xlsx files.

In addition, What type of credentials are you using in these scripts? If you mean 'service principal', power bi has some limitations of this type of credentials usage.

 

Imports - Post Import - REST API (Power BI Power BI REST APIs) | Microsoft Docs

Regards,

Xiaoxin Sheng

Hi @v-shex-msft 

 

Effectively I am using the credentials of type "service principal". As I mentioned, I only have problems with Excel files.

These are XLSX, but they do not contain a table with data, but rather a report made with Excel with its connections to SSAS.

From the PowerBI portal, I can import the file without any problem, but when I try to import it through the API, it always returns a 400 error.

 

 

Thank you very much for your help.

Anonymous
Not applicable

Hi @Ganchut,

Have you try to use the other methods to invoke the rest API? If these methods worked, they mean contain limitations to using 'service principal' credentials to invoke that API.

Regards,

Xiaoxin Sheng

Hello @Anonymous .

 

In the tests I have done I have not had problems publishing, updating, moving or deleting RDL or PBIX, I have only been unable to publish XLSX.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.