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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Query taking forever to load

 

let
    url = "https://materialplv.es/wp-json/wc/v3/orders",

    get_one = (url as text,n as number) as any =>
    let 
        result = try Table.FromRecords(Json.Document(Web.Contents(url&"?per_page=15&page="&Number.ToText(n)))) otherwise -1
    in 
        result,
    get_em_all = (tabla as table,url as text,n as number) =>
    let
        get_next = get_one(url,n),
        result = if get_next<>-1 then @get_em_all(tabla&get_next,url,n+1) else tabla
    in 
        result,
    Origen = get_em_all(get_one(url,1),url,2)
in
    Origen

 

This piece of code takes forever to load for something which should be pretty simple. Idk why. also I am suppoused to pass a header called rel with the value "next" to web contents, in order to get the next page instead of trying to build it manually, but when i do I get an error telling me that that paramenter its allowed only when conected anonimously and most of the data I require from that API is only accesible via authentication.

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

The "authentication" is baked into the Power Query code itself through the API key, so setting the authentication method to anonymous works perfectly in Power BI desktop.

Solved: Anonymous access - Microsoft Power BI Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I cannot do that, because with anonymous cretentials, the API restricts the access to some necesary data.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.