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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.