<?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: New API Endpoint with DAX Queries in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2083304#M31862</link>
    <description>&lt;P&gt;I am now receiving "401 unauthorized error" while using SPN.&lt;/P&gt;&lt;P&gt;Any thoughts on what might be missing?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 18:06:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-17T18:06:00Z</dc:date>
    <item>
      <title>New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/1998477#M30920</link>
      <description>&lt;P&gt;MS recently announced support for DAX queries against published Power BI datasets through a new api endpoint:&amp;nbsp;&lt;A href="https://powerbi.microsoft.com/en-us/blog/announcing-the-public-preview-of-power-bi-rest-api-support-for-dax-queries/" target="_blank"&gt;Announcing the public preview of Power BI REST API support for DAX Queries | Microsoft Power BI Blog | Microsoft Power BI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attempted the same setup using PowerShell cmdlets, but no matter which DAX query I provide it, I don't get any data back.&amp;nbsp; The error I receive in PowerShell looks something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;+ $result = Invoke-PowerBIRestMethod -Method Post -URL $requestURL -Bod ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMe&lt;BR /&gt;thod], AggregateException&lt;BR /&gt;+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;BR /&gt;&lt;BR /&gt;Cannot index into a null array.&lt;BR /&gt;+ $parsed.results[0].tables[0].rows | Format-List&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of one of the queries that I recently tried:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;$requestURL = "datasets/8e66523b-b39b-42a5-a5b5-0d542365434/executeQueries"

$requestBody = @"
{
    "queries":
    [
        {
        "query": "SUMMARIZE(Proposals, Proposals[DOCUMENT_ID], \"Total\", SUM(Proposals[DOCUMENT_TOTAL_AMT]))"
        }
    ]
}
"@

Login-PowerBI
$result = Invoke-PowerBIRestMethod -Method Post -URL $requestURL -Body $requestBody

$parsed = $result | ConvertFrom-Json
$parsed.results[0].tables[0].rows | Format-List&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts on what I may be doing wrong here?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:20:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/1998477#M30920</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-04T19:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2004963#M30994</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code format looks like as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{ “queries”: [{“query”:”&amp;lt;Your DAX Query&amp;gt;“}], “serializerSettings”:{“incudeNulls”: true}}&lt;/LI-CODE&gt;
&lt;P&gt;Please &lt;SPAN&gt;add the permissions for read and write in API permission in Azure Portal and see if the script then works.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please check whether you have enable the permission in Admin portal in Power BI Service.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please check whether you have Build permission to this dataset and check whether this workspace is V2 instead of V1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Current limitations in a nutshell:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only 1 DAX query can be executed per REST API request.&lt;/LI&gt;
&lt;LI&gt;Each DAX query can have only 1 result set.&lt;/LI&gt;
&lt;LI&gt;Result sets are capped at 100k rows.&lt;/LI&gt;
&lt;LI&gt;Supported data types: string, numeric, boolean, blank, datetime and variant. Binary is not supported.&lt;/LI&gt;
&lt;LI&gt;Azure AS and SSAS do not support this DAX REST API.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 07:25:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2004963#M30994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-09T07:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2006212#M31010</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp; I'm using the PowerShell cmdlets, and the documentation states "&lt;SPAN&gt;The Power BI Management cmdlets have the required app permissions to use the DAX REST API".&amp;nbsp; I don't think I should need adjust any App permissions in Azure because of this.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have verified that the Allow XMLA Endpoints and Analyze in Excel setting is enabled for the entire organization.&amp;nbsp; Also, the account I'm using is the owner of the dataset, so it definitely has build permissions.&amp;nbsp; I've also tried publishing the dataset to "My Workspace" and a v2 workspace.&amp;nbsp; It doesn't seem to matter which workspace it's published to.&amp;nbsp; I get the same error regardless.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any other ideas or suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 15:23:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2006212#M31010</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-09T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2008119#M31032</link>
      <description>&lt;P&gt;Is there any chance this is only available to first/targeted release tenants or users?&amp;nbsp; It didn't state it anywhere in the blog post, but I just tested the same dataset in our test tenant and I was able to connect from the Powershell cmdlets.&amp;nbsp; I'm almost certain that our test tenant is first/targeted release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: I'm not sure that would be the case either as my account has the targeted options enabed in both our test and production tenants.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 15:19:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2008119#M31032</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-10T15:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2025138#M31214</link>
      <description>&lt;P&gt;I have exactly the same kind of issue as you &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;. Same error message.&lt;BR /&gt;I have also verified that the Rest API is enabled in the admin portal and that I have build access to the dataset.&lt;/P&gt;&lt;P&gt;$requestUrl = '&lt;A href="https://api.powerbi.com/v1.0/myorg/datasets/e500cd5d-4e48-4feb-80d5-33435a5c9a16/executeQueries" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/datasets/e500cd5d-4e48-4feb-80d5-33435a5c9a16/executeQueries&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;$requestBody = @"&lt;BR /&gt;{ “queries”: [{“query”:”EVALUATE SUMMARIZECOLUMNS('Movements[countryCode]', \"Ship Count\", [shipCount])“}], “serializerSettings”:{“incudeNulls”: true}}&lt;BR /&gt;"@&lt;/P&gt;&lt;P&gt;Write-Host $requestBody&lt;/P&gt;&lt;P&gt;Write-Host 'Logging in'&lt;BR /&gt;Login-PowerBI&lt;BR /&gt;Write-Host 'Logged In'&lt;BR /&gt;$result = Invoke-PowerBIRestMethod -Method POST -Url $requestUrl -Body $requestBody&lt;BR /&gt;Resolve-PowerBIError -Last&lt;BR /&gt;Write-Host 'Invoked'&lt;BR /&gt;$result&lt;BR /&gt;$parsed = $result | ConvertFrom-Json&lt;BR /&gt;$parsed.results[0].tables[0].rows | Format-List&lt;BR /&gt;Write-Host 'Done'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following response:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Logged In&lt;BR /&gt;Invoke-PowerBIRestMethod : One or more errors occurred.&lt;BR /&gt;At C:\Users\lchh\OneDrive - Bunker Holding Group\PowerShell\SampleDaxRestAPI.ps1:26 char:11&lt;BR /&gt;+ $result = Invoke-PowerBIRestMethod -Method POST -Url $requestUrl -Bod ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException&lt;BR /&gt;+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/P&gt;&lt;P&gt;Exception : System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).&lt;BR /&gt;at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()&lt;BR /&gt;at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.&amp;lt;InvokeRestMethod&amp;gt;d__35.MoveNext()&lt;BR /&gt;InnerException : False&lt;BR /&gt;Message : Response status code does not indicate success: 400 (Bad Request).&lt;BR /&gt;StackTrace : at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()&lt;BR /&gt;at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.&amp;lt;InvokeRestMethod&amp;gt;d__35.MoveNext()&lt;BR /&gt;HelpLink :&lt;BR /&gt;Source : System.Net.Http&lt;BR /&gt;ErrorDetails :&lt;BR /&gt;ErrorCategory : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException&lt;BR /&gt;InvocationInfo : System.Management.Automation.InvocationInfo&lt;BR /&gt;ScriptStackTrace : at &amp;lt;ScriptBlock&amp;gt;, C:\Users\lchh\OneDrive - Bunker Holding Group\PowerShell\SampleDaxRestAPI.ps1: line 26&lt;/P&gt;&lt;P&gt;Invoked&lt;BR /&gt;Cannot index into a null array.&lt;BR /&gt;At C:\Users\lchh\OneDrive - Bunker Holding Group\PowerShell\SampleDaxRestAPI.ps1:31 char:1&lt;BR /&gt;+ $parsed.results[0].tables[0].rows | Format-List&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (:) [], RuntimeException&lt;BR /&gt;+ FullyQualifiedErrorId : NullArray&lt;BR /&gt;&lt;BR /&gt;Done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;is there anyway that this is not rolled out to our Power BI tenants?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 06:41:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2025138#M31214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-19T06:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2026760#M31228</link>
      <description>&lt;P&gt;I finally got this partially worked out with the help of one of the very helpful Power BI engineers.&amp;nbsp; For some reason datasets in My Workspace don't seem to be getting proper build permissions, so I decided to switch to just testing datasets in my v2 workspaces.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I initally thought that I had to use the format&amp;nbsp;&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}&lt;/A&gt;&amp;nbsp;because that is what I'm accustomed to doing.&amp;nbsp; This will probably change as this gets closer to GA, but for now you actually just remove the parts about the group and reference the dataset directly.&amp;nbsp; For example:&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/datasets/f388a618-2c93-41c5-8528-44c0c1129d70/executeQueries" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/datasets/f388a618-2c93-41c5-8528-44c0c1129d70/executeQueries&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I made that change, I was able to return data from a Powershell script and Postman.&amp;nbsp; Still not sure about the permssions in My Workspace, but I'll likely never use that anway.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 18:45:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2026760#M31228</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-19T18:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2027462#M31234</link>
      <description>&lt;P&gt;Thank you so much for your response&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;.&lt;BR /&gt;I'm really happy that you succeeded, because then I know there is a way.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I did go through the concerns that you describe.&lt;/P&gt;&lt;P&gt;1) My request url is directly to the dataset + '/executeQueries'&lt;/P&gt;&lt;P&gt;2) My workspace is a V.2 workspace&lt;/P&gt;&lt;P&gt;3) I am admin of the workspace, but just to make sure, I have given myself Build permissions directly on the dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please provide you code as sample code, so I can copy as much as possible from working powershell code, &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 06:15:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2027462#M31234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T06:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2027891#M31238</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;&amp;nbsp;I am quite embarrassed. There was a quirk in my code. I put a ' in the wrong place in the DAX code. It is working perfectly. Thanks for putting me on the right track.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 09:20:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2027891#M31238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T09:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2028096#M31243</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;Meh.&amp;nbsp; Things happen.&amp;nbsp; I'm really glad you were able to get it worked out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 12:29:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2028096#M31243</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-20T12:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049522#M31453</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/347"&gt;@rjhale&lt;/a&gt;&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;Could you please post your full working code? I am also having the same issues but having a hard time following the fixes in this thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My powershell code:&lt;/P&gt;&lt;PRE&gt;$requestUrl = "datasets/291666dc-09a2-44e3-ba8b-24b590fd9331/executeQueries"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$requestBody = @"&lt;BR /&gt;{ “queries”: [{“query”:”EVALUATE SUMMARIZE('Calendar','Calendar'[Year],"Days in year",COUNT('Calendar'[Date]))“}], “serializerSettings”:{“incudeNulls”: true}}&lt;BR /&gt;"@&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Login-PowerBI&lt;BR /&gt;$result = Invoke-PowerBIRestMethod -Method Post -Url $requestUrl -Body $requestBody&lt;BR /&gt;$parsed = $result | ConvertFrom-Json&lt;BR /&gt;$parsed.results[0].tables[0].rows | Format-List&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error (same as yours):&lt;/P&gt;&lt;PRE&gt;Invoke-PowerBIRestMethod : One or more errors occurred.&lt;BR /&gt;At J:\test.ps1:35 char:11&lt;BR /&gt;+ $result = Invoke-PowerBIRestMethod -Method Post -Url $requestUrl -Bod ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateExce &lt;BR /&gt;ption&lt;BR /&gt;+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error suggests that the DAX is wrong, but it's copy/pasted from the source .pbix file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jhayes0128_0-1630431969062.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/584445i744C9EBE99776168/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jhayes0128_0-1630431969062.png" alt="jhayes0128_0-1630431969062.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried removing the ' in the DAX. I have tried different urls. Same error every time. I'm losing it over here so any help you can provide is appreciated!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 17:53:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049522#M31453</guid>
      <dc:creator>jhayes0128</dc:creator>
      <dc:date>2021-08-31T17:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049663#M31457</link>
      <description>&lt;P&gt;One thing I noticed is that you didn't escape your double quotes in query.&amp;nbsp; In the blog post they Kay mentions &lt;STRONG&gt;and don’t forget to escape quotation marks with a backslash (\”).&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;The latest query that I copy and pasted from Power BI Desktop looked like this:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;DEFINE
  VAR __DS0Core = 
    SUMMARIZECOLUMNS(
      'Proposals'[DOCUMENT_ID],
      \"SumDOCUMENT_DIRECT_AMT\", CALCULATE(SUM('Proposals'[DOCUMENT_DIRECT_AMT]))
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(501, __DS0Core, 'Proposals'[DOCUMENT_ID], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  'Proposals'[DOCUMENT_ID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 19:22:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049663#M31457</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-31T19:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049699#M31459</link>
      <description>&lt;P&gt;Same error&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt; Would you be able to post your $requestBody?&lt;/P&gt;&lt;PRE&gt;$requestBody = @"&lt;BR /&gt;{“queries”: [{“query”:”EVALUATE SUMMARIZE('Calendar','Calendar'[Year],\"Days in year\",COUNT('Calendar'[Date]))“}], “serializerSettings”:{“incudeNulls”: true}}&lt;BR /&gt;"@&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Aug 2021 19:54:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049699#M31459</guid>
      <dc:creator>jhayes0128</dc:creator>
      <dc:date>2021-08-31T19:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049738#M31460</link>
      <description>&lt;P&gt;The last query that I posted was actually from a Power Automate variable that I was working with.&amp;nbsp; I also tested a different query using Powershell, and here is an example of the $requestBody variable:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;$requestBody = @"
{
    "queries":
    [
        {
        "query": "
DEFINE
  VAR __DS0FilterTable = 
    TREATAS({\"CHEM\"}, 'Proposals'[DOCUMENT_DEPT_NAME])

  VAR __DS0Core = 
    SUMMARIZECOLUMNS(
      'Proposals'[DOCUMENT_ID],
      __DS0FilterTable,
      \"SumDIRECT_AMT\", CALCULATE(SUM('Proposals'[DIRECT_AMT]))
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(501, __DS0Core, 'Proposals'[ID], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  'Proposals'[ID]"
        }
    ]
}
"@@&lt;/LI-CODE&gt;&lt;P&gt;I would also make sure that your double quotes are the correct type of double quotes.&amp;nbsp; I'm not sure if you copy and pasted right from your PS script, but it looks to me like you have two different types of double quotes being used.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 20:16:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2049738#M31460</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-08-31T20:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2050409#M31469</link>
      <description>&lt;P&gt;And&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/319766"&gt;@jhayes0128&lt;/a&gt;. I also noted that in your code, you are not only using straight quotes (sorry for the probably not fully correct term). You should use " and not&amp;nbsp;&lt;SPAN&gt;“ or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;”.&lt;/SPAN&gt;&lt;BR /&gt;Here is my simple request body:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Here comes the DAX query wrapped in the request body.
# Using @" "@ makes the text literal, which is much easier
# Not that " in the DAX query must be preceeded by a \
# Port Calls Query - List ship count per country code
$requestBody = @" 
{ 
    "queries": 
    [
        {"query":
            "EVALUATE SUMMARIZECOLUMNS(
                'Movements'[countryCode], 
                \"Ship Count\", [shipCount]
                )"
        }
    ], 
    "serializerSettings":{"incudeNulls": true}}
"@&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 06:13:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2050409#M31469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-01T06:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2051480#M31481</link>
      <description>&lt;P&gt;You are my hero&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;!!!! IT WORKS!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I never would've guessed this fix. thank you thank you thank you!!!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 13:21:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2051480#M31481</guid>
      <dc:creator>jhayes0128</dc:creator>
      <dc:date>2021-09-01T13:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2076857#M31758</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Can someone pls point to what is missing in my approach.I spent lot of time trying to fix this but i coundt so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a lot of things but i got a different error now and not sure of the reason.I was able to run dataset refresh and GET methods but unsuccessful with this "executing of DAX"&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pBI1234_1-1631684249956.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/593779i77A4B724C38B2CBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pBI1234_1-1631684249956.png" alt="pBI1234_1-1631684249956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Error is constantly pointing to something wrong at the client end request and i am not sure what more to fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DAX_question.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/593773i1F3F48A84EAC7E25/image-size/large?v=v2&amp;amp;px=999" role="button" title="DAX_question.png" alt="DAX_question.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried the same with refreshes endpoint as below and the service principal was able to refresh the dataset.&lt;/P&gt;&lt;P&gt;# refresh&lt;BR /&gt;$uri = "&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/$GroupId/datasets/$DatasetId/refreshes" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/$GroupId/datasets/$DatasetId/refreshes&lt;/A&gt;"&lt;BR /&gt;Invoke-RestMethod -Uri $uri –Headers $headers –Method POST –Verbose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I also used -Headers in the executequeries rest api but it didnt make a difference&lt;/LI&gt;&lt;LI&gt;I registered an Azure app ,obtained the AppID,secretvalue,tenantID.I provided dataset.read and write permission for the app to call REST api.&lt;/LI&gt;&lt;LI&gt;I created an AAD security group and added the service principal account into it as a member.&lt;/LI&gt;&lt;LI&gt;Installed and imported all MicrosoftPowerBIMgmt modules in powershell&lt;/LI&gt;&lt;LI&gt;Service principal is granted Admin on the dataset it is trying to query.&lt;/LI&gt;&lt;LI&gt;Workspace is&amp;nbsp; V2&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 05:46:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2076857#M31758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T05:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2077612#M31766</link>
      <description>&lt;P&gt;I think you're running into the same problem that I was.&amp;nbsp; Please look at my reply from 8/19.&amp;nbsp; You can't use the URL with&amp;nbsp;&lt;EM&gt;groups/groupid&lt;/EM&gt; in it.&amp;nbsp; For now, you have to reference the dataset without that information.&amp;nbsp; For example:&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/datasets/f388a618-2c93-41c5-8528-44c0c1129d70/executeQueries" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.powerbi.com/v1.0/myorg/datasets/f388a618-2c93-41c5-8528-44c0c1129d70/executeQueries&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 11:43:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2077612#M31766</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-09-15T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078347#M31777</link>
      <description>&lt;P&gt;I already tried that abs URL method and it doesnt work either.I get the same 400 (bad request) error.&lt;/P&gt;&lt;P&gt;Could you please provide all the steps you took to get this working end to end.It will be very helpful for many of us.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 17:41:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078347#M31777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T17:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078374#M31778</link>
      <description>&lt;P&gt;For testing purposes, I was simply using PowerShell to authenticate and get a bearer token with my own credentials in the exact same way that Kay outlined in the Power BI blog post from last month.&amp;nbsp; I would start troubleshooting by making sure you can use your own creds to return data from that dataset using the excecuteQueries endpoint.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also try using the "&lt;SPAN class="hljs-pscommand"&gt;Resolve-PowerBIError&lt;/SPAN&gt;&lt;SPAN class="hljs-parameter"&gt; -Last" command in PowerShell to see if you can get more information about where the invoke method is going wrong. Just a thought.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 18:08:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078374#M31778</guid>
      <dc:creator>rjhale</dc:creator>
      <dc:date>2021-09-15T18:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: New API Endpoint with DAX Queries</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078392#M31779</link>
      <description>&lt;P&gt;I use my cred initially and it didnt work.I also looked at the error but it is not very helpful.&lt;/P&gt;&lt;P&gt;I tried the same exact code few days ago with my creds and it hadnt worked,then i started the SP route.&lt;/P&gt;&lt;P&gt;This is what i get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pBI1234_0-1631730465718.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/594249iF89A787BF85555EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pBI1234_0-1631730465718.png" alt="pBI1234_0-1631730465718.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 18:29:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/New-API-Endpoint-with-DAX-Queries/m-p/2078392#M31779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T18:29:03Z</dc:date>
    </item>
  </channel>
</rss>

