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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pupreti
Frequent Visitor

Odbc.Query does not work with Direct Query option in Custom Power BI connector

Hi, 

I am trying to create my own custom connector for Presto and i was trying to pass SQL query using Odbc.Query function with Direct Query enabled but I am getting below error when i am trying to load data for reports generation.

"We couldn't connect to your DirectQuery data source or internal model. Double-check that your server and database names are correct, and that you have permission to access them. DirectQuery error: DirectQuery may not be used with this data source – please consider moving to a supported data source or upgrading the SQL Server data source to the latest available version."

 

Is this feature not supported for Custom connector or is it a bug on power bi side as i have tried various ways to fix it, like updating my power bi desktop to latest, run power bi desktop in admin mode, using latest presto server version but nothing works. 

Below is my code snippet. SQl query works fine for import options but it is not working for Direct Qery option.

Connect = 
            if (SQL = null) then 
                Odbc.DataSource(ConnectionString, [
                HierarchicalNavigation = true,
                HideNativeQuery = false,
                TolerateConcatOverflow = true,
                SqlCompatibleWindowsAuth = false,
                ClientConnectionPooling= true,
                SoftNumbers = true,
                SqlCapabilities = [
                    PrepareStatements = true,
                    SupportsTop = true,
                    Sql92Conformance = 8,
                    SupportsNumericLiterals = true,
                    SupportsStringLiterals = true,
                    SupportsOdbcDateLiterals = true,
                    SupportsOdbcTimeLiterals = true,
                    SupportsOdbcTimestampLiterals = true
                    ]
                ])
            else
                Odbc.Query(
                ConnectionString, 
                SQL)
    in
        Connect;

 Please reply. Thanks in advance.

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @pupreti ,

 

Please refer to the article.

DirectQuery DataDirect ODBC drivers in Power BI 

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

@pupreti , I think direct query source are limited to given in the list

https://docs.microsoft.com/en-us/power-bi/connect-data/power-bi-data-sources

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , i think that list is for the the connectors that comes with power bi and not for the case of local custome connector.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors