<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to upload Excel data via API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-upload-Excel-data-via-API/m-p/2731239#M38211</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/410431"&gt;@risDS&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Quick solution&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Edit your workbook in Excel.&lt;/LI&gt;
&lt;LI&gt;Select the range of cells that contain your data. The first row should contain your column headers (the column names).&lt;/LI&gt;
&lt;LI&gt;Press&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Ctrl + T&lt;SPAN&gt;&amp;nbsp;to create a table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Save your workbook.&lt;/LI&gt;
&lt;LI&gt;Return to Power BI and import your workbook again&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need create a data model in your excel when you want to upload excel to power bi serive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more details, you can refer this link.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/service-admin-troubleshoot-excel-workbook-data" target="_blank" rel="noopener"&gt;Error: We couldn't find any data in your Excel workbook - Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2022 02:09:17 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-08-29T02:09:17Z</dc:date>
    <item>
      <title>Unable to upload Excel data via API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-upload-Excel-data-via-API/m-p/2722317#M38128</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I am trying to programatically upload an Excel file (could also be a JSON file) to a workspace using the API but I can't seem to make it quite work.&lt;/P&gt;&lt;P&gt;I am using the endpoint as specified at &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group&lt;/A&gt; where the phrasing leads me to believe it should be possible to import Excel files this way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample C# code used :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public bool ImportExcelFileToWorkspace(string filePath, string filename, string displayName)
        {
            var req = new HttpRequestMessage(HttpMethod.Post, $"https://api.powerbi.com/v1.0/myorg/groups/{Context.GroupId}/imports?datasetDisplayName={displayName}");
            var content = new MultipartFormDataContent();
            Stream fileStream = File.OpenRead(filePath);
            content.Add(new StreamContent(fileStream), displayName, filename);
            req.Content = content;
            Credentials.ProcessHttpRequestAsync(req, CancellationToken.None);
            var message = Client.HttpClient.Send(req);
            return message.IsSuccessStatusCode;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a class with a Credentials fields that uses the .NET API Connector and auth is fine.&lt;/P&gt;&lt;P&gt;Both the filename and displayname variables feature the file extension.&lt;/P&gt;&lt;P&gt;Using this method, I am being return an error 400 Bad Request with detail "ExcelWorkbookHasNoDataException" which is false.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anybody successfully used this endpoint like I am intending ? Any insight as to what I might be doing wrong ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance !&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 07:15:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-upload-Excel-data-via-API/m-p/2722317#M38128</guid>
      <dc:creator>risDS</dc:creator>
      <dc:date>2022-08-24T07:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to upload Excel data via API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-upload-Excel-data-via-API/m-p/2731239#M38211</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/410431"&gt;@risDS&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Quick solution&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Edit your workbook in Excel.&lt;/LI&gt;
&lt;LI&gt;Select the range of cells that contain your data. The first row should contain your column headers (the column names).&lt;/LI&gt;
&lt;LI&gt;Press&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Ctrl + T&lt;SPAN&gt;&amp;nbsp;to create a table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Save your workbook.&lt;/LI&gt;
&lt;LI&gt;Return to Power BI and import your workbook again&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need create a data model in your excel when you want to upload excel to power bi serive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more details, you can refer this link.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/service-admin-troubleshoot-excel-workbook-data" target="_blank" rel="noopener"&gt;Error: We couldn't find any data in your Excel workbook - Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 02:09:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-upload-Excel-data-via-API/m-p/2731239#M38211</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-08-29T02:09:17Z</dc:date>
    </item>
  </channel>
</rss>

