Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Using Function.InvokeAfter() function to stop the SQL connection query being executed multiple times

Hi, This is a bit of a follow on from another post of mine on the same parent requirement. The other post (see below for link) hasn't lead me to an answer so, in attempting to achieve what I need to...
  • Stachu's avatar
    Stachu
    7 years ago

    the first query is obviously running on the server, but as it's a custom SQL Power BI doesn't create it's own 'native query'
    now imagine following scenario:

     

    Query1 - connection to the SQL database, select a table
    Query2 - reference Query1, select 2 columns, filter and group by with sum (all done using the UI)

    Query3 - reference Query1, select 3 different columns, group by and count (again, only using the UI)


    In this scenario actions in Query2 and Query3 can both be performed by PowerBI and SQL. As long as the query folding is active the actions are happening on the server - that means that PowerBI 'writes' the actual SQL that is executed on the server (the 'native query'), as there was no SQL provided in the beginning. Does this clarify?