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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
saileshdhital
New Member

Data refresh disabled for dynamic sharepoint excel files

Hi,

I have the following query that is giving me an error "You can't schedule refresh for this dataset because the following data sources currently don't support refresh. Data source for Query1"
My data source sits in a folder under a sharepoint site. And I want the data source to be dynamic so that it takes the folder that has the latest quarter's data. For example, I have folders like "Q1 2023", "Q2 2023", "Q4 2023", and the query would take the latest file on the folder (Q4 2023 for today). Below is my code on the query editor:

 

let
Source = Excel.Workbook(Web.Contents("https://XXXX.sharepoint.com/sites/XXX/Shared%20Documents/"&
"Q"&Text.From(Date.QuarterOfYear(DateTime.Date(DateTime.LocalNow()))-1) &" "& Text.From(Date.Year(DateTime.LocalNow()))&
"/Testing "&
"Q"&Text.From(Date.QuarterOfYear(DateTime.Date(DateTime.LocalNow()))-1)&" "
/*Following is the code to extract the last two digits of the Year. For example, 23 for 20223*/
&Text.End(Date.ToText(DateTime.Date(DateTime.LocalNow())),2)&" - XX.xlsx"), null, true),

 

1 ACCEPTED SOLUTION
arvindsingh802
Super User
Super User

Currently Power BI service does not support refresh from dynamic data source
https://learn.microsoft.com/en-us/power-bi/connect-data/refresh-data#refresh-and-dynamic-data-source... 


To refresh dynamic data sources in Power BI Service, you can use Web.Contents() and Relative Path parameter in it, please refer:

  1. Web.Contents(), M Functions And Dataset Refresh Errors In Power BI 
  2. Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

View solution in original post

1 REPLY 1
arvindsingh802
Super User
Super User

Currently Power BI service does not support refresh from dynamic data source
https://learn.microsoft.com/en-us/power-bi/connect-data/refresh-data#refresh-and-dynamic-data-source... 


To refresh dynamic data sources in Power BI Service, you can use Web.Contents() and Relative Path parameter in it, please refer:

  1. Web.Contents(), M Functions And Dataset Refresh Errors In Power BI 
  2. Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors