Search code examples
powerbim

Change from "Import" to "Direct Query" in Power BI


I have 2 Queries in Power BI

one is Import and the other is Direct Query

I was looking at the Advance Editor for both queries.

they both look exactly the same, no difference what do ever

How can I change Import query to become Direct Query from the Advanced editor?

Import query script

let
    Source = Sql.Database("DSServer", "DSDB", [Query="EXEC stat_DailyNumbers"])
in
    Source

Direct Query script

let
    Source = Sql.Database("DSServer", "DSDB", [Query="EXEC stat_DailyNumbers"])
in
    Source

Solution

  • You cannot switch between query methods.

    Workaround:

     1. copy the code from your advanced editor to notepad.
        
     2. Create a new query, where you will be able to choose direct query / import. 
        
     3. Open advanced editor for the new query and paste the code you copied earlier.