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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors