Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi all,
I trying to fetch data via API which needed dynamic token; I am successful in retriving data in Power BI desktop but when I publish the same on Power BI Service I am getting an error (when refresh) as below,
This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources.
Here is what I had tried to get Token:
// I created parameters (URL, grant_type...) & using them here ,
---------------------------------------------------------------
= () =>
let
url = URL,
body = [
grant_type = grant_type,
client_id = client_id,
client_secret = client_secret,
username = username,
password = password
],
nice = Json.Document(Web.Contents(url,
[
Headers = [#"Content-Type" = "application/x-www-form-urlencoded"],
Content = Text.ToBinary(Uri.BuildQueryString(body))
]
)
),
niceToken = nice[access_token]
in
niceToken
---------------------------------------------------------------
Above code is successfully returning the token when I invoke it. now I am trying to use this dynamic token into the main call,
---------------------------------------------------------------
let
Source = Json.Document(Web.Contents(DataURL,
[
Headers=[Authorization="Bearer " & Token()]
]))
in
Source
---------------------------------------------------------------
Which is returning data to me in Power BI Desktop but same not working in Service; what could be the potential issue?
Appreciate your help.
Solved! Go to Solution.
I got the solution from Curbals youtube video.
all dynamic parts must be added as query then it will work.
Json.Document(Web.Contents(DataURL,
[
RelativePath = "performance?",
Query = [
startDate=sDt,
endDate=eDt
],
Headers=[Authorization="Bearer " & Token()]
]))
@Anonymous , refer if this can help
https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/
Thanks @amitchandak ,
If you look at the code I shared; I have already implemented the solution mentioned in the blog. I even getting the data but its not working in PBI Service due to dynamic parameter (dates).
Appreciate if you can help on that.
I got the solution from Curbals youtube video.
all dynamic parts must be added as query then it will work.
Json.Document(Web.Contents(DataURL,
[
RelativePath = "performance?",
Query = [
startDate=sDt,
endDate=eDt
],
Headers=[Authorization="Bearer " & Token()]
]))
Hello, I have a very similar problem when putting a dynamic hour directly in my query, could you tell me what is the link of the curbals video you are talking about?
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 18 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 38 | |
| 31 | |
| 26 |