Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am working on a portfolio project where I am trying to analyze weekly stock data over the past two years. I have connected Power BI to a free AlphaVenture API but am running into an issue when trying to run my API function as I am hitting the call limit (5 calls per minute).
Does anyone know how to get around this issue? Would really appreciate it!
Copy of my M code: https://ufile.io/gtqr80jl
Please see this article to see how to add a delay after each call.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hello,
Thank you for the quick response and the reference. I've tried to use function.invokeafter for the past couple of hours in different orders in the query but I can't seem to get it to work. I do not have much experience with M - all of my work in PowerQuery has been using the UI.
Below is a copy of my most recent attempt. I seem to be adding a delay since invoking the custom function is taking minutes as opposed to seconds, but I am still getting an error, which I'm assuming means I am delaying something other than the actual call to the API.
let
Output = Function.InvokeAfter(()=> Source, #duration(0,0,0,13)),
Source = (symbol) =>
let
Source = Json.Document(Web.Contents(
"https://www.alphavantage.co/",
[
RelativePath="query",
Query=
[
function = "TIME_SERIES_WEEKLY",
symbol=symbol,
apikey="placeholder"
]
]
)),
#"Weekly Time Series" = Source[Weekly Time Series],
#"Converted to Table" = Record.ToTable(#"Weekly Time Series"),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"1. open", "2. high", "3. low", "4. close", "5. volume"}, {"1. open", "2. high", "3. low", "4. close", "5. volume"})
in
#"Expanded Value"
in
Output
Depending on the order I add function.invokeafter in, I get errors about converting a function to a record. Would you be able to provide specific input on where/how to add the function? It would be very much appreciated since I am unfortunately very stuck.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |