<?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: PowerBI API not running query from executeQueries endpoint in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3490161#M45035</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/633209"&gt;@tech49&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;As the document mentions, current this API only support to send Dax query and T-SQL query should not be suitable for this API usages:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Executes Data Analysis Expressions (DAX) queries against the provided dataset. The dataset must reside in&amp;nbsp;&lt;STRONG&gt;My workspace&lt;/STRONG&gt;&amp;nbsp;or another workspace.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries#limitations" target="_blank" rel="noopener"&gt;Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/" target="_blank"&gt;Data Analysis Expressions (DAX) Reference - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 02:03:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-23T02:03:49Z</dc:date>
    <item>
      <title>PowerBI API not running query from executeQueries endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3484691#M44997</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm connecting fine to the PowerBI API however I can't run DAX queries.&amp;nbsp; &amp;nbsp;My end game is to assit the process of ascertaining what datasources and tables are used by what PowerBI reports.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following endpoint as shown from&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries" target="_blank" rel="noopener"&gt;Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn:&lt;/A&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;https:&lt;/SPAN&gt;&lt;SPAN&gt;//api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sending the following JSON to the API:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"queries"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"select * from $SYSTEM.TMSCHEMA_PARTITIONS"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"serializerSettings"&lt;/SPAN&gt;&lt;SPAN&gt;: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"includeNulls"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"impersonatedUserName"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;I'm getting the following error...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"message":"Error converting value \"select * from $SYSTEM.TMSCHEMA_PARTITIONS\" to type 'Microsoft.InfoNav.Explore.ServiceContracts.Internal.ExecuteDatasetQuery&lt;/SPAN&gt;&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;</description>
      <pubDate>Thu, 19 Oct 2023 05:41:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3484691#M44997</guid>
      <dc:creator>tech49</dc:creator>
      <dc:date>2023-10-19T05:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI API not running query from executeQueries endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3486908#M45009</link>
      <description>&lt;P&gt;Ok,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the first part of my problem, I serialised the JSON incorrectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have labelled the as a "query", as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"queries"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"query": &lt;/SPAN&gt;&lt;SPAN&gt;"select * from $SYSTEM.TMSCHEMA_PARTITIONS"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"serializerSettings"&lt;/SPAN&gt;&lt;SPAN&gt;: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"includeNulls"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"impersonatedUserName"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using that format, I can send a query, however I can't get a&amp;nbsp;&lt;SPAN&gt;TMSCHEMA_PARTITIONS, Now I'm getting&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;DataExtensionError,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;AnalysisServicesErrorCode&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Oct 2023 05:34:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3486908#M45009</guid>
      <dc:creator>tech49</dc:creator>
      <dc:date>2023-10-20T05:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI API not running query from executeQueries endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3490161#M45035</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/633209"&gt;@tech49&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;As the document mentions, current this API only support to send Dax query and T-SQL query should not be suitable for this API usages:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Executes Data Analysis Expressions (DAX) queries against the provided dataset. The dataset must reside in&amp;nbsp;&lt;STRONG&gt;My workspace&lt;/STRONG&gt;&amp;nbsp;or another workspace.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries#limitations" target="_blank" rel="noopener"&gt;Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/" target="_blank"&gt;Data Analysis Expressions (DAX) Reference - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 02:03:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3490161#M45035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T02:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI API not running query from executeQueries endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3490528#M45041</link>
      <description>&lt;P&gt;Given your end game is to ascertain datasource and tables per report, assuming you want something to run across the whole tenant. If this is the case, you would be better served using the Scanner APIs.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;All of the following can be obtained from GetScanResult:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Datasets will give you Tables and Datasources (Tables is simply 'tables, Datasources, you will get from datasourceUsages[datasourceInstanceId].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are many ways you can get to this data, depending on your preference. Personally, I've extended this solution&amp;nbsp;&lt;A href="https://justb.dk/blog/2021/02/extracting-power-bi-metadata-with-data-factory-part-1/" target="_blank"&gt;Extracting Power BI metadata with Data Factory (part 1) – justB smart&lt;/A&gt;&amp;nbsp;but if you don't need to store the data, the Power BI REST API Connector is much faster to get running&amp;nbsp;&lt;A href="https://www.thepoweruser.com/2021/02/21/power-bi-rest-api-connector/" target="_blank"&gt;Power BI REST API Connector — The Power User&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With your datasourceInstanceId you can related datasets to datasourceInstances (this will then give you more details about that particular datasource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can then use reports[datasetid] to link all the above back to your report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-get-scan-result" target="_blank"&gt;Admin - WorkspaceInfo GetScanResult - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 06:37:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-API-not-running-query-from-executeQueries-endpoint/m-p/3490528#M45041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T06:37:45Z</dc:date>
    </item>
  </channel>
</rss>

