Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Gurus
I am trying to pull information for certain US stocks from finance.yahoo.com
The web address follows a similar pattern for all stock symbols
https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL
So I wrote a custom function
(Ticker) => try Web.Page( Web.Contents("https://finance.yahoo.com/quote/" & Ticker & "/key-statistics?p=" & Ticker,[Timeout=#duration(0,0,0,10)])) otherwise null
and invoked it over the symbols i have.
It works but is very slow when i use 500 + symbols
I read about function.scalarvector in Chris Webb's blog
https://blog.crossjoin.co.uk/2018/11/16/function-scalarvector-optimise-power-query-m-functions/
Please could you help me optimize the web queries using this or any other way
I tried with following. It works but does not optimize the query
Function.ScalarVector( type function(Tickersymbol as text) as text, (InputTable) => let BufferTable = Table.Buffer(InputTable), InputList = BufferTable[Tickersymbol], CallFunction = GetStatistics(InputList) in CallFunction )
Please the see the file for more clarity
https://drive.google.com/file/d/12C280ItzuSf7D6cYr-Nl8wj9NzuCeAxu/view?usp=sharing
Function looks as it should, so it might not be supported by the yahoo then.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries