Forum Discussion
Replace Error with a Table of Values
Hi All,
I am creating a Currency Exchange Rates Table with a Web.BrowserContents query function (Basically passing the date in the URL to a currency exchange website and fetching the HTML table of exchange rates for that date).
The result of the function is a table with Columns Currency, Units Per EUR, EUR per Unit.
Sometimes however, it so happens that the data for a particular date isn't returned and and ERROR value is shown for that date instead of a table.
What I want to do is replace the ERROR with a static table of the 170 currency pairs with the values for Units Per EUR and EUR Per Unit as 0.
This is so that when I merge the EchangeRate table with my main query, the error is not transferred and break the query. Instead the Value would be shown as 0.
Hope you guys can help me with this.
4 Replies
- Fowmy
Super User
AchalDesai
Use the Try - - - Otherwise error handling option : https://docs.microsoft.com/en-us/power-query/handlingerrors- AchalDesaiNew Member
Hi Fowmy, The try and otherwise definitely looks helpful.
But can you guide me how I could insert a table of 2 columns and 170 rows in the otherwise part?
- Fowmy
Super User
AchalDesai
If you could provide a PBIX file with some sample data then it would be helpful for me to try a solution .