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
AVH_Tech
Frequent Visitor

Refresh Data Source Error in Power I Service when using function

I have been struggling for days to find the issue. I worked through many of the proposed solutions but I have not managed to get the refresh to work once I upload my pbix file.

 

I have a query calling a function and the query had multiple steps. As per the recomendations I found in forums I broke my query into smaller queries to ensure I sepperate and stage them correclty. I am still receiving an error so I beleive it is due to the combination of steps in the function.

 

Error:

"[Unable to combine data] Section1/ST_Data_2/Added Custom references other queries or steps, so it may not directly access a data source. Please rebuild this data combination."}}],"exceptionCulprit":1}}} Table: ST_Data_3."

 

ST_Data_2 includes a function call:

let
Source = ST_Data_Incremental_1a,
#"Added Custom" = Table.AddColumn(Source, "Custom", each GetSTdata_1([page]))
in
#"Added Custom"

 

Function GetSTdata_1([page]):

let
Source = (page_num as number) as table =>
let
page_number = Number.ToText(page_num),
page_Size = "100",
Date_From = "2020-04-09",
Source = Json.Document(Web.Contents("https://xxx.xxxxxxxx.com/",[RelativePath="Api/v3/Jobs",Query =[page=page_number,pageSize=page_Size,DateFrom=Date_From]])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{4}[Value],
#"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"id", "myId", "num", "description"})
in
#"Expanded Column1"
in
Source

 

ST_Data_3 uses ST_Data_2 as source:

let
Source = ST_Data_2,
#"Expanded Custom" = Table.ExpandTableColumn(Source, "Custom", {"id", "myId", "num", "customer"}, {"id", "myId", "num", "customer"})
in
#"Expanded Custom"

 

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @AVH_Tech 

Please test and ensure it works when invoking function "GetStData1" into "ST Data2" table.

If it doesn't work, maybe you need to change your queries.

Here are some references:

(pay attention to the queries of your function, privacy level setting,,ect)

https://www.myonlinetraininghub.com/scrape-data-multiple-web-pages-power-query

https://blog.crossjoin.co.uk/2016/10/01/using-the-invoke-custom-function-button-in-power-bi/

https://www.poweredsolutions.co/2019/03/12/data-privacy-and-the-formula-firewall/

 

 

Besides, i see there is a "expand columns" step in function "GetSTData1", why there is another "expand columns" step in "ST Data3" table? 

maybe you can delete this step in "GetSTData1".

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors