Apologies, I\'m new to Power BI. I\'m using Power BI to call an Azure API that will list all the VMs in my subscription, however it will only show the first 50 before having
For anyone interested, here is what I ended up doing thanks to this link:
https://datachant.com/2016/06/27/cursor-based-pagination-power-query/
let
iterations = 10,
url =
"https://management.azure.com/subscriptions/< subscription >/providers/Microsoft.Compute/virtualMachines?api-version=2017-12-01",
FnGetOnePage =
(url) as record =>
let
Source = Json.Document(Web.Contents(url)),
data = try Source[value] otherwise null,
next = try Source[nextLink] otherwise null,
res = [Data=data, Next=next]
in
res,
GeneratedList =
List.Generate(
()=>[i=0, res = FnGetOnePage(url)],
each [i]<iterations and [res][Data]<>null,
each [i=[i]+1, res = FnGetOnePage([res][Next])],
each [res][Data])
in
GeneratedList
1 whole day of Googling headache :S