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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Concept
New Member

Populating ODATA query from a data table

Hi Everyone,

 

I have an ODATA feed which pulls data back to PowerBI and is functioning.

 

It has been created using a blank query, where the number highlighted in blue is the data point reference

 

let
      Source = OData.Feed("https://odata.c3ntinel.com/v0.1/", null, [Implementation="2.0"]),
      SelectFunction = Source{[Name="GetCustomDatesMeterReadings",Signature="function (meterId as number, resolution as text, start_date as datetimezone, end_date as datetimezone) as nullable record"]}[Data],
     GetCustomDatesMeterReadings = SelectFunction(287915, "Month", #datetimezone(2022, 1, 1, 0, 0, 0, 0, 0), #datetimezone(2025, 01, 31, 0, 0, 0, 0, 0)),
     Readings = GetCustomDatesMeterReadings[Readings]

in
     Readings

 

I have a large number of data point references that I need to pull. 

I have already imported the list of reference numbers as a data table.

 

Is there any way of dymanically changing the reference number in the ODATA call so that I don't have to either hard code the refernce numbers or create 50+ query tables?

 

Many thanks  

1 REPLY 1
smpa01
Super User
Super User

@Concept  yes, it is doable in theory but performance will take a huge hit and it is not scalable.

 

Pseudocode

 

// write a function get_data with table_num parameter
// pseudocode
(table_num as integer)=>
let
      Source = OData.Feed("https://odata.c3ntinel.com/v0.1/", null, [Implementation="2.0"]),
      SelectFunction = Source{[Name="GetCustomDatesMeterReadings",Signature="function (meterId as number, resolution as text, start_date as datetimezone, end_date as datetimezone) as nullable record"]}[Data],
     GetCustomDatesMeterReadings = SelectFunction(table_num, "Month", #datetimezone(2022, 1, 1, 0, 0, 0, 0, 0), #datetimezone(2025, 01, 31, 0, 0, 0, 0, 0)),
     Readings = GetCustomDatesMeterReadings[Readings]

in
     Readings


//table_num list
table_num = [1,2,3,....n]

//forEach in table_num invoke get_data
List.Geneerate() - POWER Query For loop

 

 

Better alternative (if you have fabric), use notebook to perform this task.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors