//Metadata: //Programming language: Power Query M //Natural language: English //Output: currency table //Explanation: //this code generates a currency exchange rate table for the major pairs based on real time data from investing.com //How to use: //copy the code into an empty query let Source = Web.BrowserContents("https://www.investing.com/currencies/streaming-forex-rates-majors"), #"Extracted Table From Html" = Html.Table( Source, { { "Column1", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(1)" }, { "Column2", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(2)" }, { "Column3", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(3)" }, { "Column4", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(4)" }, { "Column5", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(5)" }, { "Column6", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(6)" }, { "Column7", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(7)" }, { "Column8", "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR > :nth-child(8)" } }, [ RowSelector = "TABLE.datatable_table__DE_1_.dynamic-table_dynamic-table__rxziu.datatable_table\-\-mobile-basic__rzXxT.datatable_table\-\-freeze-column__XKTDf.undefined > * > TR" ] ), #"Promoted Headers" = Table.PromoteHeaders( #"Extracted Table From Html", [PromoteAllScalars = true] ), #"Changed Type" = Table.TransformColumnTypes( #"Promoted Headers", { {"Pair", type text}, {"Bid", type text}, {"Ask", type text}, {"High", type text}, {"Low", type text}, {"Chg.", Int64.Type}, {"Chg. %", Percentage.Type}, {"Time", type time} } ), #"DUPL Pair" = Table.DuplicateColumn(#"Changed Type", "Pair", "PairCopy"), #"SPLIT Pair" = Table.SplitColumn( #"DUPL Pair", "PairCopy", Splitter.SplitTextByDelimiter("/", QuoteStyle.Csv), {"CurrencyCode1", "CurrencyCode2"} ), #"Changed Type1" = Table.TransformColumnTypes( #"SPLIT Pair", {{"CurrencyCode1", type text}, {"CurrencyCode2", type text}} ) in #"Changed Type1"