Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gluizqueiroz
Resolver I
Resolver I

Problem with automatic dataset refresh because "dynamic datasource"

When I publish my project to Power BI Web, the schedule refresh page show me the following message:

 

 

This data set includes a dynamic data source. Since dynamic data sources are not updated in the Power BI service, this data set will not be updated. Learn more: https://aka.ms/dynamic-data-sources.
Data source for Query

 

 

 

I have 1 table that was a M Power Query code to create a table with month/year starting in jan/2020 until today, and 1 column with a "default value" and a columna with "default value" + [LastDay] like the following result:

YearMonth TextMonth IntLastDayURLQuery
20200112020-31-01https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-01
20200222020-29-02https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-29-02
20200332020-31-03https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-03
20200442020-30-04https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-30-04
20200552020-31-05https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-05
20200662020-30-06https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-30-06
20200772020-31-07https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-07
20200882020-31-08https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-08
20200992020-30-09https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-30-09
202010102020-31-10https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-10
202011112020-30-11https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-30-11
202012122020-31-12https://api.mysite.com/public/v1/sales?token=abc123&filter=createdDate eq 2020-31-12

 

After that, I use the following M Code to do a request to [URL] + [Query], like the following:

 

 

#"New Column2" = Table.AddColumn(#"New Column1", "WebContent", each 
        Json.Document(
            Web.Contents(
                [URL], 
                [ 
                    Query = [#"filter" = [Query]]
                ]
            )
        )
    ),
    #"WebContent Expanded" = Table.ExpandListColumn(#"New Column2", "WebContent"),

 

 

The result of previous code is a List (I transform to Record and Expanded to new columns).

I have created this logic to do 1 request per month.

 

On Power BI Desktop it works fine and refresh correctly.

My problem is when I publish to web and try to schedule a automatic refresh. 

How can I manage this error and can schedule a automatic refresh?

 

I have searched for a solution and 1 answer say to use the param "Query" on function Web.Contents(), but it not worked.

1 REPLY 1
collinq
Super User
Super User

HI @gluizqueiroz ,

 

I think, by definition, it won't work.  According to that link in the message "In most cases, Power BI datasets that use dynamic data sources cannot be refreshed in the Power BI service." and "A dynamic data source is a data source in which some or all of the information required to connect cannot be determined until Power Query runs its query, because the data is generated in code or returned from another data source."

 

That appears to me to be what you doing.  Therefore, I don't think that there is a work-around to get the Service to actually refresh the data for you.  You might go to the Developer forum to see if somebody has an idea for you to rework your query so that you get the output that you want in a less dynamic method.  I know that I have done something similar where I add a flag to my date table something like "current month - yes/no" to make my query not be dynamic.

I would appreciate Kudos if my response was helpful. I would also appreciate it if you would Mark this As a Solution if it solved the problem. Thanks!




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.