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.
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
Solved! Go to Solution.
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
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
Thank you Xiaoxin Sheng... I have used a static path to work around the problem. Thanks for the response
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.