Converting Types
DateTime.FromText using format strings
For format strings syntax, see: dotnet/custom-date-and-time-format-strings
Web Requests
Check out the new tutorial at https://blog.powp.co/my-power-query-web-contents-cheat-sheet-6a5bbfdce5eb
Web.Contents without Refresh Errors
The main cause of Web.Contents not refreshing can be fixed by adding the options[Query]
and options[RelativeaPath]
parameters. (The UI doesn’t create them for you)
This example uses https://www.metaweather.com/api/location/search?query=london See more: Skip Test Connection
Handling Specific HTTP Error Status Codes
You can filter results based on the status code, instead of getting errors.
See more: override default error handling, and the example wait-for loop

WebRequest
: Wrapper with Better Defaults
You can get the full file with extra comments: WebRequest.pq
Chaining Web.Contents to Merge Many Queries

Html.Table – Parsing with CSS Selectors
Select a Single Element: an Image, url, text, etc…
This fetches the current heading text on the blog

Parsing Element’s Attributes

Select Tables using your own CSS Selectors

RowSelector

columnNameSelectorPairs
SQL Native Query
Parameterized SQL queries with Value.NativeQuery()
Other
Cartesian Product

Details: https://radacad.com/cartesian-product-in-power-query-multiply-all-sets-of-all-pairs-in-power-bi
Using Multiple `Enter Data` Tables in One Query
You can make start with ‘enter data’, then duplicate that line. You end up with two steps, each are their own enter data

Convert Table to JSON
Json output:
Converting a list
of items to a CSV
string
Functions
Using Optional Parameters with Default Values
The Null_coalescing_operator ??
simplifies default values.encoding
will be set to what the user passed, unless it’s null
. In that case, it is set to TextEncoding.Utf8
Mapping Function Calls based on Type
Caller chooses which type of conversioin to use, based on type names { date, datetime, datetimezone }
