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, I need help, because I want to fetch data from an API but I need this data to be updated daily and to be incremental. I don't know if using the "Incremental Refresh" functionality would work, because as an API parameter I need to pass the desired date, in this case I always want to search for a single day and always being the day before the current day.
I have two identical queries, one of them has a static date, the desired date is written in text, while the other query is using a formula to obtain yesterday's date. I need the query with yesterday's date to be executed every day, incrementing the other query.
Example: assuming that the static date is 2023-01-01, on the 3rd the dynamic query will look for data from 2023-01-02 and make the combination. On the 4th it will look for data from 2023-01-03 and combine it with the other results, resulting in a table with data from the 1st, 2nd and 3rd and so on.
The static:
body = "{
""call"":""method"",
""app_key"":""XXX"",
""app_secret"":""YYY"",
""param"":[
{
""page"": 1,
""records"": 500,
""date_start"": ""26/11/2023"",
""date_end"": ""26/11/2023""
}
]
}",
Data=Json.Document(Web.Contents(
"https://api", [
Headers=[#"Content-Type"="application/json"],
Content=Text.ToBinary(body)
]))
The dynamic:
body = "{
""call"":""method"",
""app_key"":""XXX"",
""app_secret"":""YYY"",
""param"":[
{
""page"": 1,
""records"": 500,
""date_start"": """ & DateTime.ToText(Date.AddDays(DateTime.LocalNow(),-1), [Format="dd/MM/yyyy"]) & """,
""date_end"": """ & DateTime.ToText(Date.AddDays(DateTime.LocalNow(),-1), [Format="dd/MM/yyyy"]) & """
}
]
}",
Data=Json.Document(Web.Contents(
"https://api/", [
Headers=[#"Content-Type"="application/json"],
Content=Text.ToBinary(body)
]))
You can use incremental refresh for this. Just create your RangeStart and RangeEnd parameters and use RangeStart in place of DateTime.LocalNow(). Or you could start with a single column table with your desired dates and add a custom column with the API call on each row.
Pat
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 |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |