Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello all!
I am having trouble trying to configure the scheduled refresh in Power BI because my data source is dynamic.
My query fetches ticket data from the Movidesk API. The API is paginated, and I use the List.Generate() to paginate through the $top and $skip functions from the API. I believe this is what makes the API url dynamic.
Can anyone help me on how to fix it so that I can use the scheduled refresh?
Thanks
let
// Base URL for the API call
BaseUrl = "https://api.movidesk.com",
// Function to fetch data using Web.Contents
FetchData = (baseUrl as text, skip as number) as nullable list =>
let
// Construct the relative path and query string
RelativePath = "/public/v1/tickets/past",
QueryString = [
token="secret-token",
#"$select"="id,isDeleted,createdDate,type,category,urgency,status,baseStatus,origin,owner,ownerteam,createdBy,tags,resolvedIn,reopenedIn,closedIn,lifetimeWorkingTime,stoppedTimeWorkingTime,lastUpdate,serviceFull,serviceFirstLevel,serviceSecondLevel,serviceThirdLevel,protocol,slaAgreement,slaAgreementRule,slaSolutionTime,slaResponseTime,slaSolutionChangedByUser,slaSolutionChangedBy,slaSolutionDate,slaSolutionDateIsPaused,slaResponseDate,slaRealResponseDate,type,originEmailAccount,createdBy,contactForm,actionCount,resolvedInFirstCall",
#"$orderby"="createdDate asc",
#"$expand"="owner,clients($select=id,businessName,email,personType,profileType),childrenTickets($select=id,isDeleted),parentTickets($select=id,isDeleted),assets($select=name,label,categoryFull,categoryFirstLevel,categorySecondLevel,categoryThirdLevel)",
#"$filter"="createdDate gt 2016-10-01",
#"$top"="100",
#"$skip"=Number.ToText(skip)
],
Source = Web.Contents(baseUrl, [RelativePath=RelativePath, Query=QueryString]),
Data = try Json.Document(Source) otherwise null
in
Data,
// Generate a list of data using List.Generate
Consulta2 = List.Generate(
() => [result= FetchData(BaseUrl, 0), skip = 0],
each [result] <> null and List.Count([result]) > 0,
each [result= FetchData(BaseUrl, [skip] + 100), skip =[skip] + 100],
each [result]
),
// rest of the data modelling
That's an ODATA endpoint. Use the ODATA connector.
Their documentation states that their API has some ODATA features implemented, but it is not an ODATA endpoint. So the ODATA connector does not work.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
13 | |
11 | |
8 | |
8 |
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
7 |