cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC PowerBI 2 commands in one query

mamiya
New Contributor II

 

Hello everyone,

I'm trying to use the ODBC DirectQuery option in PowerBI, but I keep getting an error about another command. The SQL query works while using the SQL Editor. Do I need to change the setup of my ODBC connector?



DECLARE dateFrom DATE = DATEADD(YEAR, -1, GETDATE());
SELECT dateFrom AS dateFrom;

 

mamiya_0-1714651686806.png

 

mamiya_3-1714651948145.png

 

 

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @mamiya , Here are a few steps you can take to address the error:

  1. Check Power Query Editor Steps:

    • The error might be related to a specific step in the Power Query Editor. Try opening the Power Query Editor and reviewing the steps. If there’s a problematic step, consider deleting it.
    • Alternatively, you can switch to import mode instead of DirectQuery mode. To do this, go to the “Home” tab in Power Query Editor and select “Close & Apply.”
  2. Clear Data Load Cache:

    • Sometimes cached data can cause issues. Try the following:
      • Go to “File” > “Options and Settings” > “Options.”
      • Navigate to “Data Load” and click on “Clear cache.”
      • Save the file and load it again.
  3. ODBC Connector Setup:

    • Ensure that your ODBC connector is configured correctly. Double-check the connection settings, credentials, and any other relevant configurations.

Remember that ODBC connections don’t inherently support DirectQuery. If you’re still facing issues, consider exploring alternative options, such as building your own ext...1.

I hope this helps! Let me know if you have any further questions or need additional assistance. 😊

 

mamiya
New Contributor II

HI thanks for replying. I tried also query the same command in python using SQL class but without any success. 

9aRxW1cRCA.png

SQL machine is configured correctly and works with PowerBI, Python if user query only one command. We would like to use parameters and create final query from other selects. Do you think it possible to use more than one command per query? 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!