Forum Discussion
inigo-montoya
Apr 21, 2022Copper Contributor
Power Query from dynamic URL
Hey Guys, so I am not too sure about my skillset but I would say im advanced ( I have played around a fair bit with power querys but mostly simple stuff as reformatting data, I havent had anythin...
- Apr 21, 2022
That could be like
let thisDate = Date.From(DateTime.LocalNow()), day = Date.Day(thisDate), adjustedDate = if day > 21 then Date.AddDays( thisDate, 15) else thisDate, year = Text.From( Date.Year(adjustedDate) ), month = Number.ToText( Date.Month(adjustedDate), "00"), URL = "https://www.google.com/sites/default/files/documents/" & year & month & "%WEIRDTEXTHERE" in URL
SergeiBaklan
Apr 21, 2022Diamond Contributor
That could be like
let
thisDate = Date.From(DateTime.LocalNow()),
day = Date.Day(thisDate),
adjustedDate =
if day > 21
then Date.AddDays( thisDate, 15)
else thisDate,
year = Text.From( Date.Year(adjustedDate) ),
month = Number.ToText( Date.Month(adjustedDate), "00"),
URL = "https://www.google.com/sites/default/files/documents/" &
year & month & "%WEIRDTEXTHERE"
in
URL
- inigo-montoyaApr 23, 2022Copper Contributorthank you very much. While I understand the code and its function, where would I put this for the query?
- SergeiBaklanApr 23, 2022Diamond Contributor
In Power Query editor that's Home->Advanced Editor and correct your code manually in it.
- inigo-montoyaApr 25, 2022Copper Contributor