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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
mvbenz
Frequent Visitor

Variables in oData URL

I have searched high and low and have as yet come up with a solution to this issue I am having.

 

I am trying to crate a dataflow for an oData source. I have the URL to pull data from and it works fine but there is a PeriodStart and End date I need to supply. If I hard code the dates it works fine. I need this to be updated incremetally so I need to incormporate the RangeStart and RangeEnd paramerters into the URL so PBi can update incrementally as its a lot of historical data along with current data.

 

When I create a varable and format a date as it needs to be I can insert that into the URL using & RangeStart & and & RangeEnd & in the dataflow online via the Advanced editor and it works fine to bring up data in the preview table.

 

When I try to save the data flow I get an error:

Can't save dataflow

One or more tables references a dynamic data source.

 

It looks like a varable isn't allowed using OData.Feed. I have read you can use Web.Content as it will handle a varable without issue but I can't get that to work. The examples are a bit vague that I have seen.

 

If I paste the OData URL in a browser with a hard coded date I get back a normal XML responce with data.

 

Anyone have any suggestions on how I can acccomplish this? I've used Web.Content for API calls with variables just fine. Its just OData.Feed isnt programmed to handle variables.

 

TIA

 

Mike...

 

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Please see this article for how to do this. You can use Web.Contents with the RelativePath and query options to get your result. Put in the base URL and then anything else before the ? in RelativePath and the stuff after the ? (the query parameters) in query.

 

Power Query - Dynamic Data Source and Web.Contents() - Hat Full of Data

 

Pat

 

Microsoft Employee

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.