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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Odbc.Query with Direct Query option does not load reports 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."

Although this works for import option and i am able to load the data also and generate reports too but its not working for direct query.

 

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 which i found from the forum only, 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.

Status: New
Comments
v-chuncz-msft
Community Support

@pupreti 

 

You may leave a comment on Github or directly create a support ticket for assistance.