Forum Discussion
Function within Function and Scheduled Refresh from PowerBI Service
Apologies, it was mislabled in the post. This is the function:
fnIteratePSTs = (PstId as text) =>
let
Source = List.Generate(
()=> [ Offset = 1, Results = fnGetTestResults(PstId, 100, 1) ],
each not (List.IsEmpty([ Results ])),
each [ Results = fnGetTestResults(PstId, 100, [Offset] + 1 ), Offset = [Offset] + 1 ],
each [Results]
)
in
SourceThis will only hurt a little: Power Query M Primer (Part 13): Tables—Table Think II | Ben Gribaudo
- Sachintha2 years ago
Helper III
Are you referring to 'disable parallel loading' as a fix? I tried it, which makes the refresh time much longer (over 2 hours), but even then it eventually failed. Same error as before.
- lbendlin2 years ago
Super User
No, I am referring to the "everything in different partitions" vs "everything in the same partition" advice. Your indicated problem was the reference to other queries, not the performance.
- Sachintha1 year ago
Helper III
In that case, I'm afraid I don't quite understand how to incorporate that solution into mine. The adivse is:
A shortcut solution: If you encounter one of these errors, place the code specific to each data source in a separate query (one query per data source) and then reference those queries from another query that combines between them.I don't quite understand what partitioning is, but going by the above, I think my sources are already in different queries? PSTs table is one, where I have the list of PstIds. Then my TestResults is a different query, which references the first since it needs to PstIds. Is that not the separation it speaks of? I don't see how else I can separate them - I can't call TestResults API without a PstId, and unless I hardcode it (which defeats the purpose of trying to do Auto Refresh anyway), I don't understand how I can call it without referncing PSTs table.
I also tried the next piece of advise:
Technically, if all data sources have a public privacy level or if all have an organization privacy level, they can be freely combined between, so the data protection level isn’t doing any protecting. Disabling it gets it out of the way, avoiding the coding constraints it imposes and any performance overhead it incurs.But that too doesn't help, and fails when refreshing from PBI Service.