Forum Discussion
Yahoo Finance Power Query Link Not Working
Essentially you need to change the source in your query.
In Power BI Use Transform Data, select the relevant query then use the Advanced Editor. You will see Source = xxxx
Previously the table was contructed as CSV it now needs to be JSON so in my case the source is...
Source = Json.Document(Web.Contents("https://query1.finance.yahoo.com/v8/finance/chart/" & StickerSymbol & "?period1=" & StartOfPeriod & "&period2=" & EndOfPeriod & "&interval=1d&events=history&includeAdjustedClose=true"))
Hi @G05DVD ,
Can you please help me?
I tried to follow the above, but unfortunatelly not fully successful. I am not good at "M".
(StockQuote as text) as table =>
let
today = Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0)),
lastyear = Duration.TotalSeconds(Date.AddYears(DateTime.LocalNow(),-5) - #datetime(1970,1,1,0,0,0)),
Source = Json.Document(Web.Contents("https://query1.finance.yahoo.com",[RelativePath="v7/finance/download/"&StockQuote&"?period1="&Number.ToText(Number.Round(lastyear))&"&period2="&Number.ToText(Number.Round(today))&"&interval=1d&events=history&includeAdjustedClose=true"]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Open", type number}, {"High", type number}, {"Low", type number}, {"Close", type number}, {"Adj Close", type number}, {"Volume", Int64.Type}})
in
#"Changed Type"