The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All,
My API needs to iterate multiple times, so I updated the M code and got the output. However, when I try to refresh the dashboard in Power BI report server, the data source isn't enabled, and when I check the data source settings in Power BI desktop, it's empty. How can I schedule the dashboard?
Below code is used in blank query.
-----------------------------------------------------------------------------------------------------------
let
// Define the function to fetch data from the API
GetData = (url) =>
let
// Make the API request
Source = Json.Document(Web.Contents(url)),
items = Source[items],
hasMore = Source[hasMore],
nextUrl = if hasMore then Source[links]{3}[href] else null,
itemsTable = Table.FromRecords(items)
in
[Items = itemsTable, HasMore = hasMore, NextUrl = nextUrl],
// Define the function to fetch data recursively
FetchDataRecursive = (url, accumulatedData) =>
let
// Fetch the next set of data
nextData = GetData(url),
// Update loop variables
newData = Table.Combine({accumulatedData, nextData[Items]}),
hasNextPage = nextData[HasMore],
nextUrl = nextData[NextUrl]
in
if hasNextPage <> false and nextUrl <> null then
@FetchDataRecursive(nextUrl, newData)
else
newData,
// Initial call to fetch data
apiUrl = "https://au.................................",
initialData = GetData(apiUrl),
finalData = FetchDataRecursive(initialData[NextUrl], initialData[Items])
in
finalData
---------------------------------------------------------------------------------------------------------------------
Datasouce is empty
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
7 | |
7 | |
3 | |
1 | |
1 |
User | Count |
---|---|
13 | |
11 | |
10 | |
3 | |
3 |