Forum Discussion

AVH_Tech's avatar
AVH_Tech
Frequent Visitor
6 years ago

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