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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Richard3
Regular Visitor

Query parameters when data source is excel workbook

This problem has been driving me round the bend for the last few days. The client for whom I'm creating reports do not have access to their main database and so far receive their data in tabula form in Excel. I want to apply parameters when importing data for Power BI reporting but have so far been unsuccessful in this as I can't use any sql queries or stored procedures. 

 

I am able to create the parameters but cannot apply them on data import. Any attempt to do so by following the steps of applying the parameter in the Data Source dialogue as outlined in the below article returns errors.

 

https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates

1 ACCEPTED SOLUTION
Chihiro
Solution Sage
Solution Sage

You could use ODBC.Query() to bring in Excel data. Though it's rather limited in what functions can be used.

 

Ex:

Connection string

dbq=\\server\FOLDER\samplefile.xlsx;defaultdir=\\server\FOLDER;driverid=1046;maxbuffersize=2048;MaxScanRows=1;pagetimeout=5;dsn=Excel Files

Then you can use something like...

Select t1.* From [Sheet1$] as t1 Where t1.Column1 >= '20'

Then in advanced editor, replace '20' with parameter value.

 

If that isn't possible, you can always use parameter to filter the data brought in.

View solution in original post

2 REPLIES 2
Richard3
Regular Visitor

This problem has been driving me round the bend for the last few days. The client for whom I'm creating reports do not have access to their main database and so far receive their data in tabula form in Excel. I want to apply parameters when importing data for Power BI reporting but have so far been unsuccessful in this as I can't use any sql queries or stored procedures. 

 

I am able to create the parameters but cannot apply them on data import. Any attempt to do so by following the steps of applying the parameter in the Data Source dialogue as outlined in the below article returns errors. 

 

https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/

Chihiro
Solution Sage
Solution Sage

You could use ODBC.Query() to bring in Excel data. Though it's rather limited in what functions can be used.

 

Ex:

Connection string

dbq=\\server\FOLDER\samplefile.xlsx;defaultdir=\\server\FOLDER;driverid=1046;maxbuffersize=2048;MaxScanRows=1;pagetimeout=5;dsn=Excel Files

Then you can use something like...

Select t1.* From [Sheet1$] as t1 Where t1.Column1 >= '20'

Then in advanced editor, replace '20' with parameter value.

 

If that isn't possible, you can always use parameter to filter the data brought in.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.