Using System Assigned Managed Identity for API imports into Azure SQL databases

For Azure SQL Databases there is a very cool new preview feature: “sp_invoke_external_rest_endpoint “. This function allows you to call certain Microsoft API endpoints directly from within your Azure database and write that data back into a table for example. With that, you can for example create a stored procedure that can be triggered from … Read more

How not to miss the last page when paging with Power BI and Power Query

paging pagination Power Query

When you use an API with a paging mechanism (like the example from this blogpost), you’ll might work with a field that contains the address for the next page. You can use this to walk through the available chunks until you reach the last element. That last element in the pagination will not contain a next-field or that field will be null.

Paging in Power Query

In Power Query you can use the function List.Generate for it. According the latest function documentation it:

Generates a list of values given four functions that generate the initial value initial, test against a condition condition, and if successful select the result and generate the next value next.

So an intuitive implementation would look like so:

paging pagination Power Query
Initial code for paging: Will miss the last element

In the initial step (row 2) the API will be called and returns this record:

Read more