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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
SV_community
Frequent Visitor

Unable to schedule refresh for dataset with excel parameter

The use case.

I have a PBIX file that contains a SQL query which has a "WHERE" clause that is parameterized. The parameter is derived from an excel workbook that user updates. 

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-use-onedrive-business-links
I am connecting to excel file on one drive as Web Source. The code works fine locally but I am unable to schedule refresh. I know it is not an issue with connecting to excel as Web source as I have done this previously for other dataset.


Please help as the user ends up opening excel file and refreshing and then opens the PBIX file to refresh. 

 

Here is the code

 

let
Source = Excel.Workbook(Web.Contents("https://xxxxxxxxxxxxx/sites/yyyyyyyyyyyyy/Shared%20Documents/Configuration/BTech%20Business%20Plan%20Data.xlsx"), null, true),
#"JobLIst(Don't Update)_Sheet" = Source{[Item="JobLIst(Don't Update)",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"JobLIst(Don't Update)_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Job Code", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each "'"&[Job Code]&"'"),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Job Code"}),
Custom = #"Removed Columns"[Custom],
Custom1 = Text.Combine(Custom,","),
Source1 =Oracle.Database("oracledbprod/prod", [HierarchicalNavigation=true]),
SQL_Code = "SELECT *
FROM da.zzzzz
WHERE JCDT_JOB_CODE IN (" & Custom1 &")",
Output = Value.NativeQuery( Source1, SQL_Code)
in
Output

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @SV_community 

If you have set up the gateway for the datasurce?

https://docs.microsoft.com/en-us/data-integration/gateway/service-gateway-onprem-indepth

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi


For datasets that connect to excel on onedrive as a web link, I always add my credenials in Data Source Credentials and dont add it to gateway as the url cannot be directly used in gateway.

 

In this instance, data source credential option is greyed out

lbendlin
Super User
Super User

what are the privacy levels for the data sources?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.