Forum Discussion

jdmbkj's avatar
jdmbkj
Regular Visitor
4 years ago
Solved

Queries after queries? Is it possible?

Hi.

 

I am new here, but Power BI Community helps me so much time so thanks for that at the beginning!

 

My question is - is it possible to make queries after queries in Power BI?

 

My example:

 

- I have connected Power BI to Oracle database

- In advanced options (in the window with "Server" and "Data Connectivity Mode") I have put my 1st SQL statement

- Then the data is imported with 1st SQL

- Now when I have my data in Power BI (as "Query1") and I want to manipulate that data with another (2nd) SQL statement

 

Is it possible or I can manipulate the data by "clicking"? If it is possible, how can I add another query?

 

Have a good day everyone.

  • Anonymous's avatar
    Anonymous
    4 years ago

    HI jdmbkj,

    Currently, you can't do this operation. The t-SQL query which wrote in the data connector will be processed when getting data to power bi, the result will be converted to query tables with not able to interact with t-SQL queries.

    If you want to custom with the first query result, please directly nested the second one with the raw query string in the data connector advance SQL statement.

    Regards,

    Xiaoxin Sheng

4 Replies

  • Hi jdmbkj ,

    Since you already have that data as Query 1 in your report.

    You can just duplicate/ reference this query to create another query as Query 2. This Query 2 will have the same data as QUery 1.

    If you want any future changes that you do in Query1 to reflect in Query 2, you should use reference and create Query 2.

    If that is not a requirement, you can just duplicate QUery 1 to create Query 2. In this case, any future changes in Query 1 will not impact Query 2. This is available in Power Query once you right click on the existing query

     

    Below is the SS

     

    • jdmbkj's avatar
      jdmbkj
      Regular Visitor

      Thank you for that. One more question. If I will change the names of columns in Query1, will it affect the column names in database? Or I can do whatever I want in Query1 (import / directquery) and it will not affect the database?

      • Thejeswar's avatar
        Thejeswar
        Icon for Super User rankSuper User

        Hi,

        The Changes that you do in Query 1 or be it in anything queries in Power BI Desktop is purely within Power BI and will not affect the database in anyway

         

        Regards,

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI jdmbkj,

    Currently, you can't do this operation. The t-SQL query which wrote in the data connector will be processed when getting data to power bi, the result will be converted to query tables with not able to interact with t-SQL queries.

    If you want to custom with the first query result, please directly nested the second one with the raw query string in the data connector advance SQL statement.

    Regards,

    Xiaoxin Sheng