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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
alexbjorlig
Helper IV
Helper IV

Help with $top, when migrating from OData to web source

For reasons related to query-folding not working with OData, I'm migrating a dataflow to using 

Json.Document(Web.Contents(BaseUrl, [Query = CombinedParams]))

Everything works great.

However, when using OData queries are automatically limited with $top, when using the Query Model Editor.

Can I somehow replicate this - is there a way to detect if we are running in preview mode?
2 REPLIES 2
alexbjorlig
Helper IV
Helper IV

Ok, I will try to explain better @Anonymous .

I'm trying to pull data from a web-api with pagination. To fetch this data, I have written a recursive M function (it looks at nextCursor and calls itself when there is anextCursor). It works and can pull in all the data with no problem.

However, when opening up the dataflow in the Power Query web editor, I notice that it's loading all data from the API, millions of rows (where the OData connector injects a $top 1000) 😲 I would not expect that, in the web editor preview I just need a preview of the data - not a million rows.

So my question is when fetching data from a web source, is it possible to detect if the query should limit itself to only 1000 rows (just like the OData connector is doing today already)?

Anonymous
Not applicable

Hi @alexbjorlig 

 

"Can I somehow replicate this - is there a way to detect if we are running in preview mode?", I don't quite understand what you mean by this statement, could you please explain it a bit more? Thank you for your time in advance.

 

Best Regards,
Yulia Xu

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.