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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.