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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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