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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
nok
Advocate II
Advocate II

Using dynamic URL with OData.Feed

Hello!

I'm creating a dataflow that connects to an ODATA with dynamic date filters, but I can't save the dataflow with the error "One or more table references a dynamic Data Source". My connection in the Advanced Editor looks like this:

let
 dateCurrentDay = DateTime.LocalNow(),
 dateTwoYearsAgo = Date.AddYears(dateCurrentDay, -2),
 dateFormat = DateTime.ToText(dateTwoYearsAgo, "yyyy-MM-ddTHH:mm:ss.99Z"),
 Fonte = OData.Feed("https://api.myodata.com/xx/v7/TableRequest$filter=UpdatedAt gt cast(" & dateFormat & ",Edm.DateTimeOffset)", null, [Implementation="2.0"]),
 Tabela = Table.StopFolding(Fonte)
in
 Tabela

 

I tried using [RelativePath] in my dynamic URL, but it doesn't seem to work with OData.Feed.

Is there any way I can make a dynamic URL connecting to an ODATA? I'm not able to save my dataflow.

1 ACCEPTED SOLUTION
kushanNa
Super User
Super User

Hi @nok 

 

simialr issue :

 

looks like he Put the query pairs into the Query section, not the Relative path section. and got it sorted :https://community.fabric.microsoft.com/t5/Power-Query/Help-with-syntax-One-or-more-table-references-...

 

so adding only Relative path only is not sufficent it seems you will need to add the query section as well 

 

check this arlticle as well :

Using OData.Feed And The Query Option To Avoid The Dynamic Data Sources Error In Power BI

 

so i'm guessing it must be something similar to this 

 

let
    dateCurrentDay = DateTime.LocalNow(),
    dateTwoYearsAgo = Date.AddYears(dateCurrentDay, -2),
    dateFormat = DateTime.ToText(dateTwoYearsAgo, "yyyy-MM-ddTHH:mm:ss.99Z"),
    
    Source = OData.Feed(
        "https://api.myodata.com/xx/v7/TableRequest", 
        null, 
        [
            Implementation = "2.0", 
            Query = [#"@updatedDate" = "cast(" & dateFormat & ",Edm.DateTimeOffset)"]
        ]
    )
in
    Source

View solution in original post

3 REPLIES 3
kushanNa
Super User
Super User

Hi @nok 

 

simialr issue :

 

looks like he Put the query pairs into the Query section, not the Relative path section. and got it sorted :https://community.fabric.microsoft.com/t5/Power-Query/Help-with-syntax-One-or-more-table-references-...

 

so adding only Relative path only is not sufficent it seems you will need to add the query section as well 

 

check this arlticle as well :

Using OData.Feed And The Query Option To Avoid The Dynamic Data Sources Error In Power BI

 

so i'm guessing it must be something similar to this 

 

let
    dateCurrentDay = DateTime.LocalNow(),
    dateTwoYearsAgo = Date.AddYears(dateCurrentDay, -2),
    dateFormat = DateTime.ToText(dateTwoYearsAgo, "yyyy-MM-ddTHH:mm:ss.99Z"),
    
    Source = OData.Feed(
        "https://api.myodata.com/xx/v7/TableRequest", 
        null, 
        [
            Implementation = "2.0", 
            Query = [#"@updatedDate" = "cast(" & dateFormat & ",Edm.DateTimeOffset)"]
        ]
    )
in
    Source
johnbasha33
Super User
Super User

Hi,
You're running into dynamic data source limitations in Power BI dataflows. Power BI restricts queries where parts of the URL (like date filters) are dynamically generated in M code, causing the "One or more tables reference a dynamic data source" error. This happens because the OData.Feed() function needs to be a foldable query for Power BI service to support scheduled refresh.

Instead of dynamically generating the URL inside let, use Power Query parameters:

  1. Go to Dataflows → Click Manage Parameters.

  2. Create a parameter:

    • Name: StartDate

    • Type: Text

    • Default Value: "2022-03-01T00:00:00.99Z"

  3. Modify your query like this:
    let
    Fonte = OData.Feed("https://api.myodata.com/xx/v7/TableRequest?$filter=UpdatedAt gt cast('" & StartDate & "',Edm.DateTimeOffset)", null, [Implementation="2.0"]),
    Tabela = Table.StopFolding(Fonte)
    in
    Tabela
    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!



Hi, @johnbasha33 .Thanks for the quick reply!

I just didn't understand the part about "Default Value: "2022-03-01T00:00:00.99Z"", because this example that you gave, the default value is a static date.
Using a parameter, isn't it possible to create a dynamic date in this default value? I want the dynamic date to always be exactly 2 years ago from the current date.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.