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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
khaox
Advocate II
Advocate II

Unable to use DIrectQuery in parameterized connection

I've created Azure SQL connection with parameters, it make unable to use directQuery

Doesn't work neither with UI defined connection nor with M script "= Sql.Database(PowerBI_server, PowerBI_database)"

 

At time of defining connection both parameters where pointing to live and accessible Azure database

 

1 ACCEPTED SOLUTION

@khaox

 

It seems like your file is already in "Import" mode (and this is indipendent from the fact you are trying to use parameters when connecting to SQL Server). Do you have any other query loaded to the model? Have you tried creating a parametrized connection to SQL Server from a blank file?

View solution in original post

6 REPLIES 6
Eric_Zhang
Microsoft Employee
Microsoft Employee

@khaox

 

Where did you try to apply the parameter? When I tried to filter rows of a DirectQuery even with a constant, I got the error "This step result is not supportted in DirectQuery mode", not to mention using a parameter. So it seems so far not supported.
Capture.PNG

pqian
Microsoft Employee
Microsoft Employee

@Eric_Zhang, Folding additional operations on top of a custom query isn't supported in DQ mode. You can simply change your custom query to reflect the operation that you are trying to do.

 

@khaox Your scenario is supported. What's the error you are getting? 

There is no error message, I'm unable to use direct query mode with parameterized connection (even if it point to the same server and database as before parameterisation).

 

 

@khaox

 

It seems like your file is already in "Import" mode (and this is indipendent from the fact you are trying to use parameters when connecting to SQL Server). Do you have any other query loaded to the model? Have you tried creating a parametrized connection to SQL Server from a blank file?

Thanks, Did it from scratch, blank project and direct query works... probably switched by accident

 

I've defined 2 parameters and applied them directly in M. 

Tried this with new connection with same results

 

SQL_Params.jpg

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.