Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
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
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
what are the privacy levels for the data sources?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
34 | |
21 | |
20 | |
14 | |
11 |
User | Count |
---|---|
22 | |
18 | |
18 | |
14 | |
14 |