Reply
Highlighted
New Member
Posts: 1
Registered: ‎03-07-2017

use power query to download daily exchange rates

Hello,

 

I'm using power query to download daily exchange rates from web source www.xe.com/currencytables.  However, I don't know how to make the date dynamic so when I refresh the query the next day, the query will know to update the date accordingly.

 

For example, the URL web source is http://www.xe.com/currencytables/?from=USD&date=2017-03-07.

 

How do I change the following syntax to make the date not static at 2017-03-07 so that when I refresh it the next day the formula will change to 2017-03-08?

 

let
    Source = Web.Page(Web.Contents("http://www.xe.com/currencytables/?from=USD&date=2017-03-07")),
    Data0 = Source{0}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Data0,{{"Currency code ▲▼", type text}, {"Currency name ▲▼", type text}, {"Units per USD", type number}, {"USD per Unit", type number}})
in
    #"Changed Type"

 

Thank you very much.

Caroline