Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Error pulling data from the PowerBI API



I want to schedule a workflow that appends data to my PowerBI dataset, by first taking the max date in the dataset, and then appending the results for every day after that to my dataset.


I'm currently struggling to read the data in the PowerBI dataset.


I've tried following this guide:


but that wasn't working for me. What I'm currently trying is this (in PowerShell)


$requestUrl = "{Workspace ID}/datasets/{Dataset ID}/executeQueries"


$requestBody = @"
{"queries" : [ {"query" : "MAXX('WaitTimes', 'WaitTimes'[UpdatedDate])"} ] , "serializerSettings" : {"includeNulls": true} }

$result = Invoke-PowerBIRestMethod -Method Post -Url $requestUrl -Body $requestBody


This code doesn't error, but it is returning a HTML document and not what I need. Does anyone have any advice?



Super User
Super User

You need to return a table. Your code is missing the EVALUATE statement.


NOTE: Power BI has no memory. You cannot append data to a regular dataset. Either use a push dataset, or use incremental refresh on a regular dataset.

Helpful resources

August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.