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
Anonymous
Not applicable

Connection Works but Refresh failing - Unable to refresh the model - unsupported data source

I am using PowerBI Service to connect to an Excel file on Sharepoint.

 

I have used an excel file ("Connection.xlsx") in a sharepoint folder with power query to load the data (add to data model) from another file, which works fine. The queried file in Power Query is also on Sharepoint. This works perfect. 

 

I reference connetion.xlsx as part of the Get Data process in Power BI Service, point it to Connection.xlsx on Sharepoint and the file loads perfectly with all rows imported. I can generate reports and dashboards. 

 

Since Connection.xlsx will be referencing a folder structure in the form of "Year-Month" (YYYY-MM) I used a simple M function in Power query to calculate the month.... called "Full_Path"

Full_Path:
() =>
let
xPath = "https://blahblah.sharepoint.com/blahblah/Shared Documents/" & DateTime.ToText(DateTime.LocalNow(),"yyyy-MM") & "/"
in
xPath

 

My Query then becomes.... 


let
Source = Excel.Workbook(Web.Contents(Full_Path() & "blah.xlsx"), null, true),
Table_ES_Table = Source{[Item="Table_ES",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Table_ES_Table,{{"Product Name", type text}, {"Product Version", type text}})
in
#"Changed Type"

 

As say, this all works fine. No problem, the "Full_Path" M function works as expected. 

 

However, when I go to shedule a refresh it fails with:

Unable to refresh the model (id=689018) because it references an unsupported data source.

 

(NOte: the data is loading fine in Power Query and Power BI even with this M Function. Its just the refresh that fails. 

 

If I remove the "Full_Path()" function and hard code the sharepoint path, this refresh starts working again. 

 

Is there any known workaround here for when the the power query is a just a little bit complex that it stops the query from refreshing. 

 

Thanks for the assisance. 

Gerard

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Current customize function only available on power bi desktop. If you want to use it on power bi service, you should use static path to locate the file.(replace the source file to show different file)

 

In addition, you can also post this idea(power bi service support custom function) to ideas forum.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Current customize function only available on power bi desktop. If you want to use it on power bi service, you should use static path to locate the file.(replace the source file to show different file)

 

In addition, you can also post this idea(power bi service support custom function) to ideas forum.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Thank you Xiaoxin Sheng... I have used a static path to work around the problem. Thanks for the response

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 Solution Authors
Top Kudoed Authors