Forum Discussion

jsBrizius's avatar
jsBrizius
Helper I
10 years ago
Solved

Direct Query with Predicate?

I have been using SQL Profiler to monitor how Power BI is querying my database while I use Direct Query.  It is selecting every row in the table.  This is very inefficient, especially if I only want to report on the current weeks data.  Does anyone know how I can use a custom query so I can add a simple WHERE clause?

  • jsBrizius in power bi desktop, for sql connector you can define custom sql queries.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

2 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    jsBrizius in power bi desktop, for sql connector you can define custom sql queries.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    • jsBrizius's avatar
      jsBrizius
      Helper I

      ankitpatira, thank you for pointing that out.  I did not see that option.  I will give this a try.  Is there a way to pass parameters?

       

      I see there is a checkbox for "Include relationship columns" and "Navigate using full hierarchy".  Maybe these allow you to pass parameters somehow.  They must be documented somewhere.