Forum Discussion

keondopark's avatar
keondopark
Regular Visitor
9 years ago

Changing datasource in Direct query mode

Hi

 

I am now authoring Power Bi report connecting to SQL Azure database using direct query. We frequently create new databases, so I should change data source whenever a new database is created. I use File - Options and settings - Data source settings to change the data source. It generally works fine, but sometimes it shows below message, even though all queries are coming from the same data source : 

 

"Connecgin to tables from more than one database is not supported in DirectQuery mode."

 

I am suspecting duplicated queries from other queries cause this issue, but not sure... If you have any idea, please let me know.

Thanks.

6 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    keondopark

     

    I don't see that error by changing the datasource that way in your post. Please check your queries one by obe in "Edit Queries"->"Adavanced Editor" to ensure that only one database is invloved. By the way, you may consider to use Parameters  instead of that way.

     

    • keondopark's avatar
      keondopark
      Regular Visitor

      Hi Eric

       

      It generally works okay, but sometimes the error occurs and I do not know why.

      Maybe I should change the way I use datasource as you directed - using Parameters.

      • JakobGsvendsen's avatar
        JakobGsvendsen
        Frequent Visitor

        I have same issue... I managed to make it go away by removing the one parameter I had on the report

         

        (it was called username, with value username() )

         

        luckily i dont need it right now.

        but It does seem there is a bug when checking multiple sources.. as it shoulnd fail on a parameter value

  • krousseau's avatar
    krousseau
    Regular Visitor

    I have same issue, it refreshes in the preview ok but when apply and close i get error "Connectin got tables from more than one database isn't supported in DirectQuery Mode"

     

  • krousseau's avatar
    krousseau
    Regular Visitor

    I have same issue, it refreshes in the preview ok but when apply and close i get error "Connectin got tables from more than one database isn't supported in DirectQuery Mode"