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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

PowerBI Service - Odata - Error Dynamic Source

Dear Friends,

 

I have an Odata Link from which i retrieve records from Business Central. The M Query i use to get all 2,5 million records finally works in PowerBI Desktop. It does work in the preview of powerbi online to. However, when i try to publish i get the following Error: One or more tables refer to a dynamic data source. The M Query below is what i use.

There are several blogs online wich seem to adress this issue, but i cant get anyone of them to work. Can anyone help?


https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...



Paramter for the BaseUrl: https://api.businesscentral.dynamics.com/v2.0/9558-623452d0dbf2/Test/api/tcg/bi/v2.0/companies(ee11-...

 

 

let

  // Function to fetch data from a single page URL

  FetchPage = (url as text) as list =>

    let

        // Fetch the JSON document from the URL

        Fetch = Json.Document(Web.Contents(url)),

        // Extract the data from the response

        Data = Fetch[value]

    in

        Data,

  // Base URL parameter

  BaseUrl = BaseUrl,

  // Reference to the BaseUrl parameter

  // Number of records per page

  PageSize = 20000,

  // Generate the list of URLs for pagination

  GenerateUrls = List.Transform({0..999}, each BaseUrl & "?" & "$skip=" & Text.From(PageSize * _) & "&$top=" & Text.From(PageSize)),

  // Function to fetch data until there are no more records

  FetchAllData = List.Generate(

        () => [PageIndex = 0, Data = FetchPage(GenerateUrls{0})],

        each List.Count([Data]) > 0 and [PageIndex] < List.Count(GenerateUrls),

        each [PageIndex = [PageIndex] + 1, Data = FetchPage(GenerateUrls{[PageIndex]})],

        each [Data]

    ),

  // Combine all fetched data

  AllData = List.Combine(FetchAllData),

  // Convert the list to a table and expand the entryNo column

  ResultTable = Table.FromList(AllData, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

  #"Expanded Column1" = Table.ExpandRecordColumn(ResultTable, "Column1", {"entryNo"}, {"entryNo"}),

  #"Kolommen transformeren" = Table.TransformColumnTypes(#"Expanded Column1", {{"entryNo", type text}}),

  #"Fouten vervangen" = Table.ReplaceErrorValues(#"Kolommen transformeren", {{"entryNo", null}})

in

  #"Fouten vervangen"

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @SearchKnowledge 

 

Unfortunately, you cannot have a dynamic data source connection in the power BI service. You would need to create a. static connection in order to get the data loading.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi Gilbert, thank you for your reaction. That is very unfortunate, so how can i get the paginated records through an API then? Because i can load it static with WEB API, but then it only loads the first 20.000 records.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.