Forum Discussion
nikhil0511
Advocate I
5 years agoGetting 52 week high and Low Currency exchange rate
Hello, I have data with Products and their Prices in USD. I like to convert the prices into EUR. As the prices can be dynamic, I like to calculate average of 52 week -high and low rates, and aga...
mahoneypat
Microsoft Employee
5 years agoHere is one way to do it using the Web connector and your url (choosing Table 1 in the popup). To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below. You could also switch to the US url. With this one, you can ration the US and EUR rows in a measure or column if needed.
let
Source = Web.BrowserContents("https://www.msn.com/en-gb/money/currencyconverter"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", ".cntrycol *"}, {"Column2", ".cnvrsncol *"}, {"Column3", ".chng-value *"}, {"Column4", ".chp-value *"}, {"Column5", ".cntrycnvrsn + *"}, {"Column6", ".chcpclub + *"}, {"Column7", ".mjcurrncs-data .rng52wkcol + *"}}, [RowSelector=".mcrow"]),
#"Renamed Columns" = Table.RenameColumns(#"Extracted Table From Html",{{"Column1", "Currency"}, {"Column2", "Conversion"}, {"Column3", "Change"}, {"Column4", "Percent"}, {"Column5", "Price"}, {"Column6", "High"}, {"Column7", "Low"}})
in
#"Renamed Columns"
Pat
- nikhil05115 years ago
Advocate I
Thank you for the solution.