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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jan_k123
Frequent Visitor

Scheduling a multiple REST API call with Power BI Service

In Desktop I got a parameterized function working feeding off a REST API service. Then I wanted it to be scheduled on Power BI Service. But got this error:

Query contains unsupported function. Function name: Web.Contents

 

I have used 2 parameters:  (start as text, count as text) => 

let qQQQ = (start as text, count as text) =>
let
    Bron = Xml.Tables(Web.Contents("https://api.QQQ.com?qualifier=effectiveDate%3E%3D(NSCalendarDate)'2019-01-01%2000%3A00%3A00'%20AND%20attributeEntityName%20%3D%20'CRMatch'%20AND%20attributeName%3D'statusInfo'&start="&start&"&count="&count&"&ordering=(%7Bkey%3DeffectiveDate%3Bsel%3DDescending%7D)&show=effectiveDate&show=effectiveEndDate&show=id1&show=id2&show=toMatch.owner.userID&show=attributeValue.displayName&show=attributeValue.statusInfoID"))
in
    Bron
in qQQQ

Then I applied this against a list:  = List.Generate(()=>0, each _ < 67000, each _ + 1000) 

In a new query i invoked a custom function with Column1 = the List function and Column2 = 1000. After that I add the web-query which has the start and count params. 

The result should be it gets 1000 records at a time, otherwise it fails/time-out. In PBI Desktop it works, but on Service I can't schedule it. 

 

Can you help me out with the refresh on PBI Service? (I am using basic auth with user and pass)

Thanks! 

1 ACCEPTED SOLUTION
3 REPLIES 3
blopez11
Super User
Super User

The power bi service doesn't like dynamic URLs as the first paramenter to Web.Contents.  You need to break up your URL using the Web.Contents RelativePath and Query options.  The first parameter to Web.Contents is usually the root URL, then you use RelativePath and Query options to extend

 

See the below for details: https://docs.microsoft.com/en-us/powerquery-m/web-contents

So I need to get in url and possibly the qualifiers and show's in as well?

(url as text, qualifiers as text, start as text, count as text) =>

How does that look like after the Web.Contents(" ?

 

Not entirely sure I understand the RelativePath and Query options. Can you explain or give an example? Thanks. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.