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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
bgorog
Frequent Visitor

Advanced Power M + Incremental refresh

Dear All, I have written an API call to request data from our team's UiPath Orchestrator server. (using odata, swagger 2.0)
Here I would like to use incremental refresh, to request only data between RangeStart and RangeEnd parameters required for incremental refresh.

The incremental refresh seems to be working when I'm filtering the already downloaded data, but here in the request somehow does not work, cannot recognize the data behind the parameter. I just need to filter the downloaded data already here, because the api call takes unnecessarily long time - more than half an hour and a lot of memory during the data transfer.

The request itself is fine working when I'm changing the parametername to a static datetime text in the right format.

Could you help me how to fix it if possible? Thank You!

Edit: the code works in PowerBI Desktop mode but does not in online "service" mode.

 

The piece of code:

 

 

Path = "/odata/QueueItems?$filter=(QueueDefinitionId eq 311 or QueueDefinitionId eq 95) and CreationTime gt "&DateTime.ToText(RangeStart,"yyyy-MM-dd'T'HH:mm:ss'Z'")&" and CreationTime le "&DateTime.ToText(RangeEnd,"yyyy-MM-dd'T'HH:mm:ss'Z'"),

Auth = Json.Document(Web.Contents(BaseUrl, [Headers=[#"Content-Type"="application/json"], Content=Json.FromValue(Credentials), RelativePath="/api/account/authenticate"])),
Token = Auth[result],


Source = Json.Document(Web.Contents(BaseUrl, [Headers=[Accept="application/json", #"Authorization"="Bearer " & Token], RelativePath=Path, Timeout=#duration(0,0,30,0) ])),

 

 

3 REPLIES 3
Mrithya
New Member

Hi @bgorog ,
Have you figured out the issue? Is it working in Power Bi service?

TIA

Hi @Mrithya, yes there was a bug with power BI, not with my report/Dataset. I had to publish the report + dataset to a new created workspace,and  the request immediately worked for me.

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @bgorog - have you considered using the Power Query Diagnostic or Fiddler trace to see how many times the Power Query is executing the API call.  I just think it might be attempting to call the data multiple times so the 30 minute time out never occurs.  You could probably confirm that Power Query is doing something unnecessary from call the API in Visual Studio Code or Postman.   

If you find that Power Query is doing something unusual, you may want to consider switching to using Power Automate to call the JSON file.  Store the JSON file in SharePoint, or parse it into a Dataverse table.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.